summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-03-06 07:18:50 +0100
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 10:14:19 +0100
commitf7c00338cfeef125032aa12aa8ebeacf9e117e81 (patch)
tree3fc55d603a0c59aa8a4db63e4acc63b26170b7cb
parent[SPARC64]: Simplify TSB insert checks. (diff)
downloadlinux-f7c00338cfeef125032aa12aa8ebeacf9e117e81.tar.xz
linux-f7c00338cfeef125032aa12aa8ebeacf9e117e81.zip
[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>
-rw-r--r--arch/sparc64/mm/init.c5
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)
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;