Re: [PATCH] phy: usb: Fix USB 3.0 clock reference leak in brcm_usb_phy_dvr_init()
From: Manivannan Sadhasivam
Date: Mon Oct 12 2026 - 12:22:53 EST
On Thu, Sep 17, 2026 at 01:36:51PM +0000, Wentao Liang wrote:
> brcm_usb_phy_dvr_init() obtains usb_30_clk with of_clk_get_by_name(),
> which takes a reference on the clock, but returns without calling
> clk_put() when clk_prepare_enable() fails, when the suspend clock
> request is deferred, or when devm_request_irq() fails. The clock is
> only handed to the driver on the success path, so nothing releases the
> reference on these paths.
>
> Drop it from the err_put_clks label, and clear usb_30_clk on the
> -EPROBE_DEFER path where it holds an error pointer rather than a
> reference.
>
> Fixes: 49859e55e364 ("phy: usb: phy-brcm-usb: Add Broadcom STB USB phy driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
Same comment as previous patch. Handle all leaks in one patch.
- Mani
--
மணிவண்ணன் சதாசிவம்