Re: [PATCH] drivers/base/node: Fix double free in register_one_node()

From: Oscar Salvador

Date: Thu Sep 18 2025 - 09:28:22 EST


On Thu, Sep 18, 2025 at 07:55:07AM +0200, David Hildenbrand wrote:
> Yes, that matches what other users (staring at mm/memory-tiers.c) do.
>
> I wonder if we should just inline register_node() into register_one_node().
>
> Then it's clearer that we perform a put_device() already in there.
>
> On top of that, we could then just s/register_one_node/register_node/
>
> And then we could do a similar cleanup for unregister_one_node /
> unregister_node where I don't consider the split function really valuable.

Yap, that makes sense to me as well.



--
Oscar Salvador
SUSE Labs