From: Arvind Yadav Date: Fri, 12 Aug 2016 15:19:18 +0000 (+0530) Subject: power: reset: hisi-reboot: Unmap region obtained by of_iomap X-Git-Tag: v4.14-rc1~2627^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bae170efd6c42bf116f513a1dd07639d68fa71b9;p=platform%2Fkernel%2Flinux-rpi.git power: reset: hisi-reboot: Unmap region obtained by of_iomap Free memory mapping, if probe is not successful. Fixes: 4a9b37371822 ("power: reset: move hisilicon reboot code") Signed-off-by: Arvind Yadav Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/reset/hisi-reboot.c b/drivers/power/reset/hisi-reboot.c index 9ab7f56..f69387e 100644 --- a/drivers/power/reset/hisi-reboot.c +++ b/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; }