diff mbox

power: reset: zx-reboot: Unmap region obtained by of_iomap

Message ID 57d92f28.8796620a.e4584.df58@mx.google.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Arvind Yadav Sept. 14, 2016, 11:05 a.m. UTC
From: Arvind Yadav <arvind.yadav.cs@gmail.com>

Free memory mapping, if probe is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/power/reset/zx-reboot.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Sebastian Reichel Sept. 19, 2016, 7:26 p.m. UTC | #1
Hi,

On Wed, Sep 14, 2016 at 04:35:31PM +0530, arvind.yadav.cs@gmail.com wrote:
> From: Arvind Yadav <arvind.yadav.cs@gmail.com>
> 
> Free memory mapping, if probe is not successful.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Thanks, queued.

-- Sebastian
diff mbox

Patch

diff --git a/drivers/power/reset/zx-reboot.c b/drivers/power/reset/zx-reboot.c
index a5b0096..b0b1eb3 100644
--- a/drivers/power/reset/zx-reboot.c
+++ b/drivers/power/reset/zx-reboot.c
@@ -58,9 +58,12 @@  static int zx_reboot_probe(struct platform_device *pdev)
 	}
 
 	err = register_restart_handler(&zx_restart_nb);
-	if (err)
+	if (err) {
+		iounmap(base);
+		iounmap(pcu_base);
 		dev_err(&pdev->dev, "Register restart handler failed(err=%d)\n",
 			err);
+	}
 
 	return err;
 }