Skip to content

Commit 2560db6

Browse files
Jinjie RuanPaolo Abeni
authored andcommitted
net: phy: Fix missing of_node_put() for leds
The call of of_get_child_by_name() will cause refcount incremented for leds, if it succeeds, it should call of_node_put() to decrease it, fix it. Fixes: 01e5b72 ("net: phy: Add a binding for PHY LEDs") Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Jinjie Ruan <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent c2eb062 commit 2560db6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/phy/phy_device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3347,11 +3347,13 @@ static int of_phy_leds(struct phy_device *phydev)
33473347
err = of_phy_led(phydev, led);
33483348
if (err) {
33493349
of_node_put(led);
3350+
of_node_put(leds);
33503351
phy_leds_unregister(phydev);
33513352
return err;
33523353
}
33533354
}
33543355

3356+
of_node_put(leds);
33553357
return 0;
33563358
}
33573359

0 commit comments

Comments
 (0)