From: "Rob Herring (Arm)" <robh@kernel.org>
To: Lizhi Hou <lizhi.hou@amd.com>
Cc: lpieralisi@kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] of: dynamic: Fix memleak when of_pci_add_properties() failed
Date: Wed, 20 Aug 2025 18:31:15 -0500 [thread overview]
Message-ID: <175572873285.1571546.13547404345424444866.robh@kernel.org> (raw)
In-Reply-To: <20250818152221.3685724-1-lizhi.hou@amd.com>
On Mon, 18 Aug 2025 08:22:21 -0700, Lizhi Hou wrote:
> When of_pci_add_properties() failed, of_changeset_destroy() is called to
> free the changeset. And of_changeset_destroy() puts device tree node in
> each entry but does not free property in the entry. This leads to memory
> leak in the failure case.
>
> In of_changeset_add_prop_helper(), add the property to the device tree node
> deadprops list. Thus, the property will also be freed along with device
> tree node.
>
> Fixes: b544fc2b8606 ("of: dynamic: Add interfaces for creating device node dynamically")
> Reported-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
> Closes: https://lore.kernel.org/all/aJms+YT8TnpzpCY8@lpieralisi/
> Tested-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
> ---
> drivers/of/dynamic.c | 3 +++
> 1 file changed, 3 insertions(+)
>
Applied, thanks!
prev parent reply other threads:[~2025-08-20 23:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 15:22 Lizhi Hou
2025-08-20 23:31 ` Rob Herring (Arm) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=175572873285.1571546.13547404345424444866.robh@kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhi.hou@amd.com \
--cc=lpieralisi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®