From: Eric B Munson Date: Thu, 13 Jan 2011 23:47:28 +0000 (-0800) Subject: hugetlb: fix handling of parse errors in sysfs X-Git-Tag: v2.6.38-rc1~89 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73ae31e5986a4c0ee84bfd13ccd9b57a98956f6f;p=pandora-kernel.git hugetlb: fix handling of parse errors in sysfs When parsing changes to the huge page pool sizes made from userspace via the sysfs interface, bogus input values are being covered up by nr_hugepages_store_common and nr_overcommit_hugepages_store returning 0 when strict_strtoul returns an error. This can cause an infinite loop in the nr_hugepages_store code. This patch changes the return value for these functions to -EINVAL when strict_strtoul returns an error. Signed-off-by: Eric B Munson Reported-by: CAI Qian Cc: Andrea Arcangeli Cc: Eric B Munson Cc: Michal Hocko Cc: Nishanth Aravamudan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed