From: Conor Dooley <conor.dooley@microchip.com>
To: <stable@vger.kernel.org>
Cc: <conor@kernel.org>, <conor.dooley@microchip.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Greentime Hu <greentime.hu@sifive.com>,
Zong Li <zong.li@sifive.com>,
Palmer Dabbelt <palmer@rivosinc.com>,
Sasha Levin <sashal@kernel.org>,
Yang Yingliang <yangyingliang@huawei.com>
Subject: [PATCH 5.15 1/3] soc: sifive: l2_cache: fix missing iounmap() in error path in sifive_l2_init()
Date: Fri, 21 Apr 2023 14:58:16 +0100 [thread overview]
Message-ID: <20230421-brownnose-resend-337d31a61751@wendy> (raw)
In-Reply-To: <20230421-scam-karma-3de5bf7904b3@wendy>
From: Yang Yingliang <yangyingliang@huawei.com>
commit 73e770f085023da327dc9ffeb6cd96b0bb22d97e upstream.
Add missing iounmap() before return error from sifive_l2_init().
Fixes: a967a289f169 ("RISC-V: sifive_l2_cache: Add L2 cache controller driver for SiFive SoCs")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
[conor: ccache -> l2_cache]
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
drivers/soc/sifive/sifive_l2_cache.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/sifive/sifive_l2_cache.c b/drivers/soc/sifive/sifive_l2_cache.c
index 59640a1d0b28..483aeaf0d405 100644
--- a/drivers/soc/sifive/sifive_l2_cache.c
+++ b/drivers/soc/sifive/sifive_l2_cache.c
@@ -212,7 +212,8 @@ static int __init sifive_l2_init(void)
intr_num = of_property_count_u32_elems(np, "interrupts");
if (!intr_num) {
pr_err("L2CACHE: no interrupts property\n");
- return -ENODEV;
+ rc = -ENODEV;
+ goto err_unmap;
}
for (i = 0; i < intr_num; i++) {
@@ -220,7 +221,7 @@ static int __init sifive_l2_init(void)
rc = request_irq(g_irq[i], l2_int_handler, 0, "l2_ecc", NULL);
if (rc) {
pr_err("L2CACHE: Could not request IRQ %d\n", g_irq[i]);
- return rc;
+ goto err_unmap;
}
}
@@ -233,5 +234,9 @@ static int __init sifive_l2_init(void)
setup_sifive_debug();
#endif
return 0;
+
+err_unmap:
+ iounmap(l2_base);
+ return rc;
}
device_initcall(sifive_l2_init);
--
2.39.2
next prev parent reply other threads:[~2023-04-21 13:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 13:58 [PATCH 5.15 0/3] sifive ccache error handling backports for 5.15 Conor Dooley
2023-04-21 13:58 ` Conor Dooley [this message]
2023-04-21 13:58 ` [PATCH 5.15 2/3] soc: sifive: l2_cache: fix missing free_irq() in error path in sifive_l2_init() Conor Dooley
2023-04-23 13:11 ` Greg Kroah-Hartman
2023-04-24 9:30 ` Conor Dooley
2023-04-21 13:58 ` [PATCH 5.15 3/3] soc: sifive: l2_cache: fix missing of_node_put() " Conor Dooley
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=20230421-brownnose-resend-337d31a61751@wendy \
--to=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=greentime.hu@sifive.com \
--cc=gregkh@linuxfoundation.org \
--cc=palmer@rivosinc.com \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=yangyingliang@huawei.com \
--cc=zong.li@sifive.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