Skip to content

Commit bae170e

Browse files
ArvindYadavCssre
authored andcommitted
power: reset: hisi-reboot: Unmap region obtained by of_iomap
Free memory mapping, if probe is not successful. Fixes: 4a9b373 ("power: reset: move hisilicon reboot code") Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 7a4947c commit bae170e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/power/reset/hisi-reboot.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ static int hisi_reboot_probe(struct platform_device *pdev)
5353

5454
if (of_property_read_u32(np, "reboot-offset", &reboot_offset) < 0) {
5555
pr_err("failed to find reboot-offset property\n");
56+
iounmap(base);
5657
return -EINVAL;
5758
}
5859

5960
err = register_restart_handler(&hisi_restart_nb);
60-
if (err)
61+
if (err) {
6162
dev_err(&pdev->dev, "cannot register restart handler (err=%d)\n",
6263
err);
64+
iounmap(base);
65+
}
6366

6467
return err;
6568
}

0 commit comments

Comments
 (0)