From: Andi Kleen Date: Tue, 21 Feb 2006 02:27:59 +0000 (-0800) Subject: [PATCH] Fix units in mbind check X-Git-Tag: v2.6.16-rc5~94 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9c930bac163c5e616ca0ba9378e7dc746c93227;p=platform%2Fkernel%2Flinux-3.10.git [PATCH] Fix units in mbind check maxnode is a bit index and can't be directly compared against a byte length like PAGE_SIZE Signed-off-by: Andi Kleen Cc: Chris Wright Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c index bedfa4f..6422fe4 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -808,7 +808,7 @@ static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask, nodes_clear(*nodes); if (maxnode == 0 || !nmask) return 0; - if (maxnode > PAGE_SIZE) + if (maxnode > PAGE_SIZE*BITS_PER_BYTE) return -EINVAL; nlongs = BITS_TO_LONGS(maxnode);