linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v.1] power:reset:hisi-reboot :- Unmap a region obtained by remap.
@ 2016-08-12 15:19 Arvind Yadav
  0 siblings, 0 replies; only message in thread
From: Arvind Yadav @ 2016-08-12 15:19 UTC (permalink / raw)
  To: sre, dbaryshkov, dwmw2; +Cc: linux-pm, linux-kernel, Arvind Yadav

iounmap frees the mapping when failed to find reboot-offset property
and cannot register restart handler.

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

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-12 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-12 15:19 [v.1] power:reset:hisi-reboot :- Unmap a region obtained by remap Arvind Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).