]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: fix division by 0 in percpu_pagelist_fraction()
authorSasha Levin <levinsasha928@gmail.com>
Thu, 3 May 2012 05:43:09 +0000 (15:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:46:11 +0000 (15:46 +1000)
commit6830236e41b6c8a8de9e69c041e73ab81a841337
treed98fa98191783c90fadad26e9258027838640cff
parent233e654b4101026e525e5385abcd094da5e12269
mm: fix division by 0 in percpu_pagelist_fraction()

percpu_pagelist_fraction_sysctl_handler() has only considered -EINVAL as a
possible error from proc_dointvec_minmax().  If any other error is
returned, it would proceed to divide by zero since
percpu_pagelist_fraction wasn't getting initialized at any point.  For
example, writing 0 bytes into the proc file would trigger the issue.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Reviewed-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c