From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-renesas-soc@vger.kernel.org>
Cc: <clement.leger@bootlin.com>, <olteanv@gmail.com>,
<f.fainelli@gmail.com>, <davem@davemloft.net>
Subject: [PATCH -next] net: dsa: rzn1-a5psw: add missing of_node_put() in a5psw_pcs_get()
Date: Wed, 29 Jun 2022 17:24:35 +0800 [thread overview]
Message-ID: <20220629092435.496051-1-yangyingliang@huawei.com> (raw)
of_parse_phandle() will increase the refcount of 'pcs_node', so add
of_node_put() before return from a5psw_pcs_get().
Fixes: 888cdb892b61 ("net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/net/dsa/rzn1_a5psw.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index 3e910da98ae2..301171ee1061 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -923,6 +923,7 @@ static int a5psw_pcs_get(struct a5psw *a5psw)
return 0;
free_pcs:
+ of_node_put(pcs_node);
of_node_put(port);
of_node_put(ports);
a5psw_pcs_free(a5psw);
--
2.25.1
next reply other threads:[~2022-06-29 9:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 9:24 Yang Yingliang [this message]
2022-06-29 9:49 ` [PATCH -next] net: dsa: rzn1-a5psw: add missing of_node_put() in a5psw_pcs_get() Clément Léger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220629092435.496051-1-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox