net: xgene: fix mdio_np leak in xgene_mdiobus_register()
The for_each_child_of_node() loop captures mdio_np via break,
holding the refcount. of_mdiobus_register() does not consume the
reference, so it leaks on success.
Put it after registration.
Fixes: e6ad767305 ("drivers: net: Add APM X-Gene SoC ethernet driver support.")
Signed-off-by: Shitalkumar Gandhi <shitalkumar.gandhi@cambiumnetworks.com>
Link: https://patch.msgid.link/20260507142024.811543-1-shitalkumar.gandhi@cambiumnetworks.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
master
parent
69754da484
commit
a450063ef8
|
|
@ -910,7 +910,9 @@ static int xgene_mdiobus_register(struct xgene_enet_pdata *pdata,
|
|||
return -ENXIO;
|
||||
}
|
||||
|
||||
return of_mdiobus_register(mdio, mdio_np);
|
||||
ret = of_mdiobus_register(mdio, mdio_np);
|
||||
of_node_put(mdio_np);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Mask out all PHYs from auto probing. */
|
||||
|
|
|
|||
Loading…
Reference in New Issue