summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJinjie Ruan <ruanjinjie@huawei.com>2024-08-30 04:20:25 +0200
committerPaolo Abeni <pabeni@redhat.com>2024-09-03 12:38:17 +0200
commit2560db6ede1aaf162a73b2df43e0b6c5ed8819f7 (patch)
treea1019028c519eb26bf40ba1ef82a9e3049abe4ab /drivers
parentMerge branch 'net-ethernet-ti-am65-cpsw-fix-xdp-implementation' (diff)
downloadlinux-2560db6ede1aaf162a73b2df43e0b6c5ed8819f7.tar.xz
linux-2560db6ede1aaf162a73b2df43e0b6c5ed8819f7.zip
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: 01e5b728e9e4 ("net: phy: Add a binding for PHY LEDs") Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20240830022025.610844-1-ruanjinjie@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/phy_device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 7752e9386b40..6bb2793de0a9 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -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;
}