Skip to content
Commit 0cbcc929 authored by Miaohe Lin's avatar Miaohe Lin Committed by Linus Torvalds
Browse files

kernel/resource: fix kfree() of bootmem memory again

Since commit ebff7d8f ("mem hotunplug: fix kfree() of bootmem
memory"), we could get a resource allocated during boot via
alloc_resource().  And it's required to release the resource using
free_resource().  Howerver, many people use kfree directly which will
result in kernel BUG.  In order to fix this without fixing every call
site, just leak a couple of bytes in such corner case.

Link: https://lkml.kernel.org/r/20220217083619.19305-1-linmiaohe@huawei.com
Fixes: ebff7d8f

 ("mem hotunplug: fix kfree() of bootmem memory")
Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Suggested-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Alistair Popple <apopple@nvidia.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b3d7fe86
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment