Re: [PATCH] drivers/base/memory: make memory block get/put explicit
From: Oscar Salvador
Date: Mon May 11 2026 - 08:20:52 EST
On Mon, May 11, 2026 at 07:18:00PM +0800, Muchun Song wrote:
> Rename the memory block lookup helper to make the acquired reference
> explicit, add memory_block_put() to wrap put_device(), and collapse the
> redundant section-number wrapper into a single block-id based lookup
> interface.
>
> This makes it clearer to callers that a successful lookup holds a
> reference that must be dropped, reducing the chance of forgetting the
> matching put and leaking the memory block device reference.
>
> Link: https://lore.kernel.org/linux-mm/7887915D-E598-42B3-9AFE-BFFBACE8DE2D@xxxxxxxxx/#t
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Acked-by: Oscar Salvador <osalvador@xxxxxxx>
Thanks, it looks more solid to me!
--
Oscar Salvador
SUSE Labs