From: Simon Horman <horms@kernel.org>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
grygorii.strashko@ti.com, kuba@kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, richardcochran@gmail.com,
stable@vger.kernel.org
Subject: Re: [PATCH] net: ethernet: ti: cpts: Fix refclk node leak in cpts_of_mux_clk_setup()
Date: Mon, 21 Sep 2026 12:02:23 +0100 [thread overview]
Message-ID: <20260921110223.GJ13925@horms.kernel.org> (raw)
In-Reply-To: <20260917114616.2149617-1-vulab@iscas.ac.cn>
On Thu, Sep 17, 2026 at 11:46:16AM +0000, Wentao Liang wrote:
> cpts_of_mux_clk_setup() takes a reference on the "cpts-refclk-mux" child
> node that is only released on the mux_fail error path. When the mux clock
> provider is registered successfully, the reference is leaked.
> of_clk_add_hw_provider() keeps its own reference on the node, so release
> the one taken here before returning.
>
> Fixes: a3047a81ba13 ("net: ethernet: ti: cpts: add support for ext rftclk selection")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/net/ethernet/ti/cpts.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
> index 2ba4c8795d60..372cef13d81e 100644
> --- a/drivers/net/ethernet/ti/cpts.c
> +++ b/drivers/net/ethernet/ti/cpts.c
> @@ -714,6 +714,8 @@ static int cpts_of_mux_clk_setup(struct cpts *cpts, struct device_node *node)
> goto mux_fail;
> }
>
> + of_node_put(refclk_np);
> +
> return ret;
I believe that of_node_put() should not be added here, but
rather it should be added to cpts_clk_del_provider().
Otherwise, what ensures that the node hasn't been reclaimed
by the time cpts_clk_del_provider() runs?
--
pw-bot: changes-requested
prev parent reply other threads:[~2026-09-21 11:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 11:46 Wentao Liang
2026-09-21 11:02 ` Simon Horman [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=20260921110223.GJ13925@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=grygorii.strashko@ti.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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®