summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorLi Yang <lidaxian@hust.edu.cn>2023-03-31 17:55:44 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-11 23:03:12 +0900
commit62cb9c468dc944ead560692397fbde6dbac1a6f0 (patch)
tree088613c9136a27ee64ed5ae0ad82603624b84fef /drivers/soc
parent724911eeaef45eb43d3ec33cb558ec777f5e6f21 (diff)
downloadlinux-stable-62cb9c468dc944ead560692397fbde6dbac1a6f0.tar.gz
linux-stable-62cb9c468dc944ead560692397fbde6dbac1a6f0.tar.bz2
linux-stable-62cb9c468dc944ead560692397fbde6dbac1a6f0.zip
soc: renesas: renesas-soc: Release 'chipid' from ioremap()
[ Upstream commit fc187a46a8e682f0f1167b230792b88de01ceaa0 ] Smatch reports: drivers/soc/renesas/renesas-soc.c:536 renesas_soc_init() warn: 'chipid' from ioremap() not released on lines: 475. If soc_dev_atrr allocation is failed, function renesas_soc_init() will return without releasing 'chipid' from ioremap(). Fix this by adding function iounmap(). Fixes: cb5508e47e60 ("soc: renesas: Add support for reading product revision for RZ/G2L family") Signed-off-by: Li Yang <lidaxian@hust.edu.cn> Reviewed-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230331095545.31823-1-lidaxian@hust.edu.cn Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/renesas/renesas-soc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c
index 621ceaa047d4..057b85b158f9 100644
--- a/drivers/soc/renesas/renesas-soc.c
+++ b/drivers/soc/renesas/renesas-soc.c
@@ -454,8 +454,11 @@ static int __init renesas_soc_init(void)
}
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
- if (!soc_dev_attr)
+ if (!soc_dev_attr) {
+ if (chipid)
+ iounmap(chipid);
return -ENOMEM;
+ }
np = of_find_node_by_path("/");
of_property_read_string(np, "model", &soc_dev_attr->machine);