From: Liang He <windhl@126.com>
To: peda@axentia.se, linux-i2c@vger.kernel.org, windhl@126.com
Subject: [PATCH] i2c: i2c-mux-gpmux: Add of_node_put() when breaking out of loop
Date: Thu, 21 Jul 2022 16:12:02 +0800 [thread overview]
Message-ID: <20220721081202.1300071-1-windhl@126.com> (raw)
In i2c_mux_probe(), we should call of_node_put() when breaking out
of for_each_child_of_node() which will automatically increase and
decrease the refcount.
Fixes: ac8498f0ce53 ("i2c: i2c-mux-gpmux: new driver")
Signed-off-by: Liang He <windhl@126.com>
---
drivers/i2c/muxes/i2c-mux-gpmux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i2c/muxes/i2c-mux-gpmux.c b/drivers/i2c/muxes/i2c-mux-gpmux.c
index d3acd8d66c32..30ab2fe88c8d 100644
--- a/drivers/i2c/muxes/i2c-mux-gpmux.c
+++ b/drivers/i2c/muxes/i2c-mux-gpmux.c
@@ -115,6 +115,7 @@ static int i2c_mux_probe(struct platform_device *pdev)
if (ret < 0) {
dev_err(dev, "no reg property for node '%pOFn'\n",
child);
+ of_node_put(child);
goto err_children;
}
--
2.25.1
next reply other threads:[~2022-07-21 8:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-21 8:12 Liang He [this message]
2022-07-21 9:20 ` [PATCH] i2c: i2c-mux-gpmux: Add of_node_put() when breaking out of loop Peter Rosin
2022-07-22 1:14 ` Liang He
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=20220721081202.1300071-1-windhl@126.com \
--to=windhl@126.com \
--cc=linux-i2c@vger.kernel.org \
--cc=peda@axentia.se \
/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