Re: [PATCH] mm/memory_hotplug: fix kfree() of bootmem memory

From: David Hildenbrand
Date: Mon Feb 07 2022 - 09:45:46 EST


On 07.02.22 14:56, Miaohe Lin wrote:
> We can't use kfree() to release the resource as it might come from bootmem.
> Use release_mem_region() instead.

How can this happen? release_mem_region() is called either from
__add_memory() or from add_memory_driver_managed(), where we allocated
the region via register_memory_resource(). Both functions shouldn't ever
be called before the buddy is up an running.

Do you have a backtrace of an actual instance of this issue? Or was this
identified as possibly broken by code inspection?

--
Thanks,

David / dhildenb