diff mbox

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

Message ID 1473850539-15721-1-git-send-email-arvind.yadav.cs@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Arvind Yadav Sept. 14, 2016, 10:55 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/xgene-reboot.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

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

On Wed, Sep 14, 2016 at 04:25:39PM +0530, Arvind Yadav 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/xgene-reboot.c b/drivers/power/reset/xgene-reboot.c
index f07e93c..73c3d93 100644
--- a/drivers/power/reset/xgene-reboot.c
+++ b/drivers/power/reset/xgene-reboot.c
@@ -81,8 +81,10 @@  static int xgene_reboot_probe(struct platform_device *pdev)
 	ctx->restart_handler.notifier_call = xgene_restart_handler;
 	ctx->restart_handler.priority = 128;
 	err = register_restart_handler(&ctx->restart_handler);
-	if (err)
+	if (err) {
+		iounmap(ctx->csr);
 		dev_err(dev, "cannot register restart handler (err=%d)\n", err);
+	}
 
 	return err;
 }