Re: [PATCH v2 1/1] x86/boot/compressed: Fix avoiding memmap in physical KASLR

From: Dave Hansen
Date: Fri Oct 24 2025 - 14:22:15 EST


On 10/23/25 16:23, Michał Cłapiński wrote:
...
> If called 5 times, on the 4th time `i` will indeed be also equal to 4
> but the last `if` never executes since `str` is null. On the 5th time,
> we exit the function via the first `if` and memmap_too_large never
> gets set.

Ahh, thanks for the explanation. The implication of the first `if` is
what I was missing.

How about we just move the `if` you suggested. Let's put it right next
to the i++ so that they're *obviously* connected and the moment `i` gets
too big, the very next thing that happens is setting `memmap_too_large`
and jumping out of the function.