Skip to content

Commit

Permalink
[SPARC64]: Fix loop termination in mark_kpte_bitmap()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Mar 20, 2006
1 parent 74ae998 commit f7c0033
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/sparc64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,12 +973,15 @@ static void __init mark_kpte_bitmap(unsigned long start, unsigned long end)
while (start < end) {
long remains;

remains = end - start;
if (remains < size_256MB)
break;

if (start & mask_256MB) {
start = (start + size_256MB) & ~mask_256MB;
continue;
}

remains = end - start;
while (remains >= size_256MB) {
unsigned long index = start >> shift_256MB;

Expand Down

0 comments on commit f7c0033

Please sign in to comment.