[PATCH] net: stmmac: dwmac-sun8i: Fix EPHY clock leak in get_ephy_nodes()

Simon Horman horms at kernel.org
Tue Sep 22 05:03:21 PDT 2026


On Thu, Sep 17, 2026 at 11:36:54AM +0000, Wentao Liang wrote:
> get_ephy_nodes() stores the clock returned by of_clk_get() directly in
> gmac->ephy_clk before the reset control is obtained. When the reset
> lookup fails, the loop continues or returns without releasing that
> clock, and sun8i_dwmac_probe() then jumps to dwmac_remove, which does
> not call clk_put(). Keep the clock in a local variable and release it
> on the error paths.
> 
> Fixes: 634db83b8265 ("net: stmmac: dwmac-sun8i: Handle integrated/external MDIOs")
> Cc: stable at vger.kernel.org
> Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>

Reviewed-by: Simon Horman <horms at kernel.org>




More information about the linux-arm-kernel mailing list