Browse Source

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 <davem@davemloft.net>
David S. Miller 16 years ago
parent
commit
c918dcce92
1 changed files with 3 additions and 0 deletions
  1. 3 0
      arch/sparc64/mm/init.c

+ 3 - 0
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