We can't use kfree() to release the resource as it might come from bootmem. Use release_mem_region() instead. Fixes: ebff7d8f270d ("mem hotunplug: fix kfree() of bootmem memory") Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx> --- mm/memory_hotplug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 7dc7e12302db..dc570772b4b1 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -216,8 +216,7 @@ static void release_memory_resource(struct resource *res) { if (!res) return; - release_resource(res); - kfree(res); + release_mem_region(res->start, resource_size(res)); } static int check_pfn_span(unsigned long pfn, unsigned long nr_pages, -- 2.23.0