From: Tobias Jordan <kernel@cdqe.de>
To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH] bus: qcom: ebi2: fix device node iterator leak
Date: Sat, 26 Sep 2020 01:45:04 +0200 [thread overview]
Message-ID: <20200925234504.GA18813@agrajag.zerfleddert.de> (raw)
In the for_each_available_child_of_node loop of qcom_ebi2_probe, add a
call to of_node_put to avoid leaking the iterator if we bail out.
Fixes: 335a12754808 ("bus: qcom: add EBI2 driver")
Signed-off-by: Tobias Jordan <kernel@cdqe.de>
---
drivers/bus/qcom-ebi2.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c
index 03ddcf426887..0b8f53a688b8 100644
--- a/drivers/bus/qcom-ebi2.c
+++ b/drivers/bus/qcom-ebi2.c
@@ -353,8 +353,10 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
/* Figure out the chipselect */
ret = of_property_read_u32(child, "reg", &csindex);
- if (ret)
+ if (ret) {
+ of_node_put(child);
return ret;
+ }
if (csindex > 5) {
dev_err(dev,
--
2.20.1
next reply other threads:[~2020-09-25 23:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 23:45 Tobias Jordan [this message]
2020-09-29 20:46 ` [PATCH] bus: qcom: ebi2: fix device node iterator leak Linus Walleij
2021-03-11 19:40 ` patchwork-bot+linux-arm-msm
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=20200925234504.GA18813@agrajag.zerfleddert.de \
--to=kernel@cdqe.de \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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