lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1471015158-6132-1-git-send-email-arvind.yadav.cs@gmail.com>
Date:	Fri, 12 Aug 2016 20:49:18 +0530
From:	Arvind Yadav <arvind.yadav.cs@...il.com>
To:	sre@...nel.org, dbaryshkov@...il.com, dwmw2@...radead.org
Cc:	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	Arvind Yadav <arvind.yadav.cs@...il.com>
Subject: [v.1] power:reset:hisi-reboot :- Unmap a region obtained by remap.

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

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ