[PATCH] phy: usb: Fix USB 3.0 clock reference leak in brcm_usb_phy_dvr_init()

Manivannan Sadhasivam mani at kernel.org
Mon Oct 12 09:04:52 PDT 2026


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 at vger.kernel.org
> Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>

Same comment as previous patch. Handle all leaks in one patch.

- Mani

-- 
மணிவண்ணன் சதாசிவம்



More information about the linux-phy mailing list