Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/dsa/hirschmann: Add missing of_node_get() in hellcreek_led_setup()

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: 7d9ee2e8ff15 ("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>

authored by

Liang He and committed by
Jakub Kicinski
16d584d2 399bd66e

+1
+1
drivers/net/dsa/hirschmann/hellcreek_ptp.c
··· 300 300 const char *label, *state; 301 301 int ret = -EINVAL; 302 302 303 + of_node_get(hellcreek->dev->of_node); 303 304 leds = of_find_node_by_name(hellcreek->dev->of_node, "leds"); 304 305 if (!leds) { 305 306 dev_err(hellcreek->dev, "No LEDs specified in device tree!\n");