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

net: sungem_phy: Add of_node_put() for reference returned by of_get_parent()

In bcm5421_init(), we should call of_node_put() for the reference
returned by of_get_parent() which has increased the refcount.

Fixes: 3c326fe9cb7a ("[PATCH] ppc64: Add new PHY to sungem")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220720131003.1287426-1-windhl@126.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Liang He and committed by
Jakub Kicinski
ebbbe23f 27161db0

+1
+1
drivers/net/sungem_phy.c
··· 450 450 int can_low_power = 1; 451 451 if (np == NULL || of_get_property(np, "no-autolowpower", NULL)) 452 452 can_low_power = 0; 453 + of_node_put(np); 453 454 if (can_low_power) { 454 455 /* Enable automatic low-power */ 455 456 sungem_phy_write(phy, 0x1c, 0x9002);