]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.88/net-amd-add-missing-of_node_put.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.88 / net-amd-add-missing-of_node_put.patch
1 From e94fb562680c41101a9caf7afc0cd40065e1b5ed Mon Sep 17 00:00:00 2001
2 From: Yangtao Li <tiny.windzz@gmail.com>
3 Date: Thu, 22 Nov 2018 07:34:41 -0500
4 Subject: net: amd: add missing of_node_put()
5
6 [ Upstream commit c44c749d3b6fdfca39002e7e48e03fe9f9fe37a3 ]
7
8 of_find_node_by_path() acquires a reference to the node
9 returned by it and that reference needs to be dropped by its caller.
10 This place doesn't do that, so fix it.
11
12 Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 ---
16 drivers/net/ethernet/amd/sunlance.c | 4 +++-
17 1 file changed, 3 insertions(+), 1 deletion(-)
18
19 diff --git a/drivers/net/ethernet/amd/sunlance.c b/drivers/net/ethernet/amd/sunlance.c
20 index 291ca5187f12..9845e07d40cd 100644
21 --- a/drivers/net/ethernet/amd/sunlance.c
22 +++ b/drivers/net/ethernet/amd/sunlance.c
23 @@ -1418,7 +1418,7 @@ static int sparc_lance_probe_one(struct platform_device *op,
24
25 prop = of_get_property(nd, "tpe-link-test?", NULL);
26 if (!prop)
27 - goto no_link_test;
28 + goto node_put;
29
30 if (strcmp(prop, "true")) {
31 printk(KERN_NOTICE "SunLance: warning: overriding option "
32 @@ -1427,6 +1427,8 @@ static int sparc_lance_probe_one(struct platform_device *op,
33 "to ecd@skynet.be\n");
34 auxio_set_lte(AUXIO_LTE_ON);
35 }
36 +node_put:
37 + of_node_put(nd);
38 no_link_test:
39 lp->auto_select = 1;
40 lp->tpe = 0;
41 --
42 2.19.1
43