Skip to content

Commit

Permalink
net/dsa/hirschmann: Add missing of_node_get() in hellcreek_led_setup()
Browse files Browse the repository at this point in the history
of_find_node_by_name() will decrease the refcount of its first arg and
we need a of_node_get() to keep refcount balance.

Fixes: 7d9ee2e ("net: dsa: hellcreek: Add PTP status LEDs")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220622040621.4094304-1-windhl@126.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Liang He authored and Jakub Kicinski committed Jun 24, 2022
1 parent 399bd66 commit 16d584d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/dsa/hirschmann/hellcreek_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ static int hellcreek_led_setup(struct hellcreek *hellcreek)
const char *label, *state;
int ret = -EINVAL;

of_node_get(hellcreek->dev->of_node);
leds = of_find_node_by_name(hellcreek->dev->of_node, "leds");
if (!leds) {
dev_err(hellcreek->dev, "No LEDs specified in device tree!\n");
Expand Down

0 comments on commit 16d584d

Please sign in to comment.