linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Tobias Jordan <kernel@cdqe.de>
To: Linus Walleij <linus.walleij@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] bus: arm: integrator: fix device node iterator leak
Date: Sat, 26 Sep 2020 01:55:41 +0200	[thread overview]
Message-ID: <20200925235541.GA28030@agrajag.zerfleddert.de> (raw)

In the for_each_available_child_of_node loop of integrator_lm_populate,
add a call to of_node_put to avoid leaking the iterator if we bail out.

Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
Signed-off-by: Tobias Jordan <kernel@cdqe.de>
---
 drivers/bus/arm-integrator-lm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c
index 845b6c43fef8..cb6da80d1c7d 100644
--- a/drivers/bus/arm-integrator-lm.c
+++ b/drivers/bus/arm-integrator-lm.c
@@ -53,6 +53,7 @@ static int integrator_lm_populate(int num, struct device *dev)
 				 base);
 			ret = of_platform_default_populate(child, NULL, dev);
 			if (ret) {
+				of_node_put(child);
 				dev_err(dev, "failed to populate module\n");
 				return ret;
 			}
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2020-09-26  0:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 23:55 Tobias Jordan [this message]
2020-09-30  8:29 ` [PATCH] bus: arm: integrator: fix device node iterator leak Linus Walleij

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=20200925235541.GA28030@agrajag.zerfleddert.de \
    --to=kernel@cdqe.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).