From 5d77cfb999845251dd6271b0e3ccf89eba26b3e2 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 3 Sep 2008 01:20:37 -0700 Subject: [PATCH] sparc64: Fix overshoot in nid_range(). [ Upstream commit c918dcce92f76bb9903e4d049f4780bad384c207 ] If 'start' does not begin on a page boundary, we can overshoot past 'end'. Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- arch/sparc64/mm/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index e289a985af84..c2094e191435 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -842,6 +842,9 @@ static unsigned long nid_range(unsigned long start, unsigned long end, start += PAGE_SIZE; } + if (start > end) + start = end; + return start; } #else -- 2.39.5