Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7c00338 authored by David S. Miller's avatar David S. Miller
Browse files

[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: default avatarDavid S. Miller <davem@davemloft.net>
parent 74ae9987
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;