Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1483182

[PATCH] power: reset: zx-reboot: Unmap region obtained by of_iomap

From arvind.yadav.cs@gmail.com
Newsgroups linux.kernel
Subject [PATCH] power: reset: zx-reboot: Unmap region obtained by of_iomap
Date 2016-09-14 13:10 +0200
Message-ID <shgeJ-6S-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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(-)

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;
 }
-- 
1.7.9.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] power: reset: zx-reboot: Unmap region obtained by of_iomap arvind.yadav.cs@gmail.com - 2016-09-14 13:10 +0200
  Re: [PATCH] power: reset: zx-reboot: Unmap region obtained by  of_iomap Sebastian Reichel <sre@kernel.org> - 2016-09-19 21:30 +0200

csiph-web