Re: [PATCH] net: mvmdio: fix clk reference leak in orion_mdio_probe()

From: Andrew Lunn

Date: Thu Oct 08 2026 - 15:21:21 EST


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