aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Yang <[email protected]>2023-03-31 17:55:44 +0800
committerGeert Uytterhoeven <[email protected]>2023-04-04 10:01:58 +0200
commitfc187a46a8e682f0f1167b230792b88de01ceaa0 (patch)
treeea64c766620e314d3dae42ed75ad491ac1ae3c27
parent1e135922f608572f216c959202d0ef303aa2a0c1 (diff)
soc: renesas: renesas-soc: Release 'chipid' from ioremap()
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 <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
-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 4ba893e45427..42af7c09f743 100644
--- a/drivers/soc/renesas/renesas-soc.c
+++ b/drivers/soc/renesas/renesas-soc.c
@@ -469,8 +469,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);