From: David S. Miller Date: Thu, 14 Aug 2008 08:41:39 +0000 (-0700) Subject: sparc64: Fix overshoot in nid_range(). X-Git-Tag: v2.6.27-rc4~45^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c918dcce92f76bb9903e4d049f4780bad384c207;p=linux-2.6 sparc64: Fix overshoot in nid_range(). If 'start' does not begin on a page boundary, we can overshoot past 'end'. Signed-off-by: David S. Miller --- diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 217de3ea29..64d8e7623e 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -796,6 +796,9 @@ static unsigned long nid_range(unsigned long start, unsigned long end, start += PAGE_SIZE; } + if (start > end) + start = end; + return start; } #else