summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/power/reset/hisi-reboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/power/reset/hisi-reboot.c')
-rw-r--r--kernel/drivers/power/reset/hisi-reboot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/drivers/power/reset/hisi-reboot.c b/kernel/drivers/power/reset/hisi-reboot.c
index 9ab7f562a..f69387e12 100644
--- a/kernel/drivers/power/reset/hisi-reboot.c
+++ b/kernel/drivers/power/reset/hisi-reboot.c
@@ -53,13 +53,16 @@ static int hisi_reboot_probe(struct platform_device *pdev)
if (of_property_read_u32(np, "reboot-offset", &reboot_offset) < 0) {
pr_err("failed to find reboot-offset property\n");
+ iounmap(base);
return -EINVAL;
}
err = register_restart_handler(&hisi_restart_nb);
- if (err)
+ if (err) {
dev_err(&pdev->dev, "cannot register restart handler (err=%d)\n",
err);
+ iounmap(base);
+ }
return err;
}