From: Dan Carpenter <dan.carpenter@oracle.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Magnus Damm <magnus.damm@gmail.com>,
Simon Horman <horms+renesas@verge.net.au>,
linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()
Date: Wed, 23 Sep 2020 11:44:58 +0300 [thread overview]
Message-ID: <20200923084458.GD1454948@mwanda> (raw)
This code needs to call iounmap() on the error paths.
Fixes: 2ed29e15e4b2 ("ARM: shmobile: R-Mobile: Move pm-rmobile to drivers/soc/renesas/")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/soc/renesas/rmobile-sysc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/soc/renesas/rmobile-sysc.c b/drivers/soc/renesas/rmobile-sysc.c
index 54b616ad4a62..d8e6dc650939 100644
--- a/drivers/soc/renesas/rmobile-sysc.c
+++ b/drivers/soc/renesas/rmobile-sysc.c
@@ -328,6 +328,7 @@ static int __init rmobile_init_pm_domains(void)
pmd = of_get_child_by_name(np, "pm-domains");
if (!pmd) {
pr_warn("%pOF lacks pm-domains node\n", np);
+ iounmap(base);
continue;
}
@@ -341,6 +342,7 @@ static int __init rmobile_init_pm_domains(void)
of_node_put(pmd);
if (ret) {
of_node_put(np);
+ iounmap(base);
break;
}
}
--
2.28.0
next reply other threads:[~2020-09-23 8:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 8:44 Dan Carpenter [this message]
2020-09-23 9:10 ` [PATCH] soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains() Geert Uytterhoeven
2020-09-23 10:28 ` Dan Carpenter
2020-09-23 11:31 ` [PATCH v2] " Dan Carpenter
2020-09-24 7:35 ` Geert Uytterhoeven
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=20200923084458.GD1454948@mwanda \
--to=dan.carpenter@oracle.com \
--cc=geert+renesas@glider.be \
--cc=horms+renesas@verge.net.au \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@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;
as well as URLs for NNTP newsgroup(s).