Skip to content

Commit a249708

Browse files
JuliaLawalldavem330
authored andcommitted
stmmac: add missing of_node_put
The function stmmac_dt_phy provides several possibilities for initializing plat->mdio_node, all of which have the effect of increasing the reference count of the assigned value. This field is not updated elsewhere, so the value is live until the end of the lifetime of plat (devm_allocated), just after the end of stmmac_remove_config_dt. Thus, add an of_node_put on plat->mdio_node in stmmac_remove_config_dt. It is possible that the field mdio_node is never initialized, but of_node_put is NULL-safe, so it is also safe to call of_node_put in that case. Signed-off-by: Julia Lawall <[email protected]> Acked-by: Alexandre TORGUE <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 501db51 commit a249708

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ void stmmac_remove_config_dt(struct platform_device *pdev,
351351
if (of_phy_is_fixed_link(np))
352352
of_phy_deregister_fixed_link(np);
353353
of_node_put(plat->phy_node);
354+
of_node_put(plat->mdio_node);
354355
}
355356
#else
356357
struct plat_stmmacenet_data *

0 commit comments

Comments
 (0)