From: Manivannan Sadhasivam <mani@kernel.org>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: alcooperx@gmail.com, bcm-kernel-feedback-list@broadcom.com,
justin.chen@broadcom.com, kishon@kernel.org,
linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
neil.armstrong@linaro.org, vkoul@kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] phy: usb: Fix USB 2.0 clock reference leak in brcm_usb_phy_dvr_init()
Date: Mon, 12 Oct 2026 21:32:59 +0530 [thread overview]
Message-ID: <as0EawoNAbEarKAT@debian> (raw)
In-Reply-To: <as0DR2jcw2mqnxKA@debian>
On Mon, Oct 12, 2026 at 09:27:07PM +0530, Manivannan Sadhasivam wrote:
> On Thu, Sep 17, 2026 at 01:35:10PM +0000, Wentao Liang wrote:
> > brcm_usb_phy_dvr_init() obtains usb_20_clk with of_clk_get_by_name(),
> > which takes a reference on the clock, but several later error returns
> > -- a failed clk_prepare_enable(), a failed devm_phy_create(), the
> > -EPROBE_DEFER paths of usb_30_clk and suspend_clk, and a failed
> > devm_request_irq() -- return without calling clk_put(). No other code
> > in the driver releases it either.
> >
> > Add an err_put_clks label that drops the reference before returning.
> >
> > Fixes: 49859e55e364 ("phy: usb: phy-brcm-usb: Add Broadcom STB USB phy driver")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
>
> Duplicate of https://lore.kernel.org/linux-phy/20260913012956.16443-1-mhun512@gmail.com
>
Sorry my bad. That patch was handling clk_prepare_enable() leak. But there is no
point in different patches doing these things. Just handle all clk leaks in
probe in a single patch.
- Mani
--
மணிவண்ணன் சதாசிவம்
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
prev parent reply other threads:[~2026-10-12 16:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 13:35 [PATCH] phy: usb: Fix USB 2.0 clock reference leak in brcm_usb_phy_dvr_init() Wentao Liang
2026-10-12 15:57 ` Manivannan Sadhasivam
2026-10-12 16:02 ` Manivannan Sadhasivam [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=as0EawoNAbEarKAT@debian \
--to=mani@kernel.org \
--cc=alcooperx@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=justin.chen@broadcom.com \
--cc=kishon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=stable@vger.kernel.org \
--cc=vkoul@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.