From: Andrew Lunn <andrew@lunn.ch>
To: zhaofeng2 <zhaofeng2@cmss.chinamobile.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] soc: dove: fix OF node leaks in dove_init_pmu()
Date: Mon, 30 Nov 2026 14:01:06 +0100 [thread overview]
Message-ID: <f5ca44b3-eddb-452d-9085-612959c15640@lunn.ch> (raw)
In-Reply-To: <20261130033828.1607-1-zhaofeng2@cmss.chinamobile.com>
On Mon, Nov 30, 2026 at 11:38:28AM +0800, zhaofeng2 wrote:
> From: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
>
> dove_init_pmu() takes two OF node references: np_pmu via
> of_find_compatible_node() and domains_node via of_get_child_by_name().
> On success np_pmu is transferred to the long-lived pmu_data
> (pmu->of_node), but several paths leak references:
>
> - missing domains node: np_pmu is leaked;
> - pmu allocation failure: np_pmu and domains_node are leaked;
> - of_iomap() failure: both are leaked (pmu is freed, dropping the
> only holder of the np_pmu reference);
> - success: domains_node is never released after the child-node
> loop.
>
> Drop the references on all these paths. The np_pmu reference on the
> success path stays with pmu->of_node, which lives for the lifetime
> of the system.
>
> Fixes: 44e259ac909f ("ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets")
> Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
Who does this bother?
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Please drop the fixes tag.
Andrew
prev parent reply other threads:[~2026-11-30 13:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 7:42 [PATCH] soc: dove: fix OF node leak " zhaofeng2
2026-11-27 14:46 ` Andrew Lunn
2026-11-30 3:38 ` [PATCH v2] soc: dove: fix OF node leaks " zhaofeng2
2026-11-30 13:01 ` Andrew Lunn [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=f5ca44b3-eddb-452d-9085-612959c15640@lunn.ch \
--to=andrew@lunn.ch \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhaofeng2@cmss.chinamobile.com \
/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®