]>
Commit | Line | Data |
---|---|---|
fe8b4b6d SL |
1 | From c5e2dec8c589406223337e362cd608bb190db07a Mon Sep 17 00:00:00 2001 |
2 | From: Sasha Levin <sashal@kernel.org> | |
3 | Date: Wed, 20 Jul 2022 21:10:03 +0800 | |
4 | Subject: net: sungem_phy: Add of_node_put() for reference returned by | |
5 | of_get_parent() | |
6 | ||
7 | From: Liang He <windhl@126.com> | |
8 | ||
9 | [ Upstream commit ebbbe23fdf6070e31509638df3321688358cc211 ] | |
10 | ||
11 | In bcm5421_init(), we should call of_node_put() for the reference | |
12 | returned by of_get_parent() which has increased the refcount. | |
13 | ||
14 | Fixes: 3c326fe9cb7a ("[PATCH] ppc64: Add new PHY to sungem") | |
15 | Signed-off-by: Liang He <windhl@126.com> | |
16 | Link: https://lore.kernel.org/r/20220720131003.1287426-1-windhl@126.com | |
17 | Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |
18 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
19 | --- | |
20 | drivers/net/sungem_phy.c | 1 + | |
21 | 1 file changed, 1 insertion(+) | |
22 | ||
23 | diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c | |
24 | index 291fa449993f..45f295403cb5 100644 | |
25 | --- a/drivers/net/sungem_phy.c | |
26 | +++ b/drivers/net/sungem_phy.c | |
27 | @@ -454,6 +454,7 @@ static int bcm5421_init(struct mii_phy* phy) | |
28 | int can_low_power = 1; | |
29 | if (np == NULL || of_get_property(np, "no-autolowpower", NULL)) | |
30 | can_low_power = 0; | |
31 | + of_node_put(np); | |
32 | if (can_low_power) { | |
33 | /* Enable automatic low-power */ | |
34 | sungem_phy_write(phy, 0x1c, 0x9002); | |
35 | -- | |
36 | 2.35.1 | |
37 |