Skip to content

Commit

Permalink
net: phy: Fix missing of_node_put() for leds
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Jinjie Ruan authored and Paolo Abeni committed Sep 3, 2024
1 parent c2eb062 commit 2560db6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -3347,11 +3347,13 @@ static int of_phy_leds(struct phy_device *phydev)
err = of_phy_led(phydev, led);
if (err) {
of_node_put(led);
of_node_put(leds);
phy_leds_unregister(phydev);
return err;
}
}

of_node_put(leds);
return 0;
}

Expand Down

0 comments on commit 2560db6

Please sign in to comment.