diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2016-08-12 20:49:18 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-30 10:18:38 +0200 |
commit | 3ee1b560e735449509791698d4772462a9205bda (patch) | |
tree | eb245db711c44873bfbeef7085ea6929907e7ff4 /drivers | |
parent | a52c63ade338cfddb7a5e779cef913624b25fded (diff) |
power: reset: hisi-reboot: Unmap region obtained by of_iomap
commit bae170efd6c42bf116f513a1dd07639d68fa71b9 upstream.
Free memory mapping, if probe is not successful.
Fixes: 4a9b37371822 ("power: reset: move hisilicon reboot code")
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/reset/hisi-reboot.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/power/reset/hisi-reboot.c b/drivers/power/reset/hisi-reboot.c index 9ab7f562a83b..f69387e12c1e 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; } |