From: Andrew Lunn <andrew@lunn.ch>
To: Haotian Zhang <vulab@iscas.ac.cn>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Josua Mayer <josua@solid-run.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: mvmdio: fix clk reference leak in orion_mdio_probe()
Date: Thu, 8 Oct 2026 21:20:43 +0200 [thread overview]
Message-ID: <d751e352-8f67-40cf-97ba-89f40adb8a69@lunn.ch> (raw)
In-Reply-To: <20261008165328.2702289-1-vulab@iscas.ac.cn>
On Fri, Oct 09, 2026 at 12:53:28AM +0800, Haotian Zhang wrote:
> orion_mdio_probe() calls of_clk_get() with index ARRAY_SIZE(dev->clk)
> purely to test whether the device tree declares more clocks than the
> driver supports. of_clk_get() takes a reference on the returned clk,
> but the return value is only checked with IS_ERR() and never released,
> so both the clk reference and the clk allocated by alloc_clk() are leaked
> whenever the DT node has more than four clocks.
>
> Store the returned clk in a local variable and release it with clk_put()
> after emitting the warning.
net-next.
Andrew
---
pw-bot: cr
next prev parent reply other threads:[~2026-10-08 19:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 16:53 Haotian Zhang
2026-10-08 16:59 ` netdev-bot+sinfo
2026-10-08 19:20 ` Andrew Lunn [this message]
2026-10-09 6:10 ` Krzysztof Kozlowski
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=d751e352-8f67-40cf-97ba-89f40adb8a69@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=josua@solid-run.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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®