提交 f7c00338 编写于 作者: D David S. Miller

[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: NDavid S. Miller <davem@davemloft.net>
上级 74ae9987
...@@ -973,12 +973,15 @@ static void __init mark_kpte_bitmap(unsigned long start, unsigned long end) ...@@ -973,12 +973,15 @@ static void __init mark_kpte_bitmap(unsigned long start, unsigned long end)
while (start < end) { while (start < end) {
long remains; long remains;
remains = end - start;
if (remains < size_256MB)
break;
if (start & mask_256MB) { if (start & mask_256MB) {
start = (start + size_256MB) & ~mask_256MB; start = (start + size_256MB) & ~mask_256MB;
continue; continue;
} }
remains = end - start;
while (remains >= size_256MB) { while (remains >= size_256MB) {
unsigned long index = start >> shift_256MB; unsigned long index = start >> shift_256MB;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册