diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-03-06 01:18:50 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:14:19 -0500 |
commit | f7c00338cfeef125032aa12aa8ebeacf9e117e81 (patch) | |
tree | 3fc55d603a0c59aa8a4db63e4acc63b26170b7cb /arch/sparc64/mm | |
parent | 74ae998772041b62e9ad420d602e4f7dbb182cd6 (diff) |
[SPARC64]: Fix loop termination in mark_kpte_bitmap()
If we were aligned, but didn't have at least 256MB left
to process, we would loop forever.
Thanks to fabbione for the report and testing the fix.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/mm')
-rw-r--r-- | arch/sparc64/mm/init.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 5930e87dafbc..9bbd0bf64af0 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -973,12 +973,15 @@ static void __init mark_kpte_bitmap(unsigned long start, unsigned long end) | |||
973 | while (start < end) { | 973 | while (start < end) { |
974 | long remains; | 974 | long remains; |
975 | 975 | ||
976 | remains = end - start; | ||
977 | if (remains < size_256MB) | ||
978 | break; | ||
979 | |||
976 | if (start & mask_256MB) { | 980 | if (start & mask_256MB) { |
977 | start = (start + size_256MB) & ~mask_256MB; | 981 | start = (start + size_256MB) & ~mask_256MB; |
978 | continue; | 982 | continue; |
979 | } | 983 | } |
980 | 984 | ||
981 | remains = end - start; | ||
982 | while (remains >= size_256MB) { | 985 | while (remains >= size_256MB) { |
983 | unsigned long index = start >> shift_256MB; | 986 | unsigned long index = start >> shift_256MB; |
984 | 987 | ||