Skip to content

Commit fc187a4

Browse files
lidaxian121geertu
authored andcommitted
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: cb5508e ("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]>
1 parent 1e13592 commit fc187a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/soc/renesas/renesas-soc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,11 @@ static int __init renesas_soc_init(void)
469469
}
470470

471471
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
472-
if (!soc_dev_attr)
472+
if (!soc_dev_attr) {
473+
if (chipid)
474+
iounmap(chipid);
473475
return -ENOMEM;
476+
}
474477

475478
np = of_find_node_by_path("/");
476479
of_property_read_string(np, "model", &soc_dev_attr->machine);

0 commit comments

Comments
 (0)