Re: [PATCH] mm/sparse: fix preinited section_mem_map clobbering on failure path

David Hildenbrand (Arm)
2026-04-02T07:56:25Z

On 4/2/26 09:37, Donet Tom wrote:
>
> On 4/1/26 12:55 PM, David Hildenbrand (Arm) wrote:
>> On 4/1/26 04:41, Muchun Song wrote:
>>>
>>> Thanks.
>>>
>>> It's truly a coincidence — I also have a piece of code locally
>>> that does something similar. Since allocation failure would also
>>> affect subsequent startup processes, I simply made it panic when
>>> allocation fails.
>> Don't use BUG_ON, use actual panic(). :)
>
>
> Apologies if I’m missing something, but would it make sense to check the
> section validity in memmap_init() instead of panicking? Is there a
> reason this is avoided?

Not sure I understand your question, but trying to handle memmap
allocations during early boot should be removed. If that ever happens
something is fundamentally flawed.

--
Cheers,

David