[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190309035024.31298-1-kjlu@umn.edu>
Date: Fri, 8 Mar 2019 21:50:24 -0600
From: Kangjie Lu <kjlu@....edu>
To: kjlu@....edu
Cc: pakki001@....edu, Clemens Ladisch <clemens@...isch.de>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH] char: hpet: fix a missing check of ioremap
Check if ioremap fails, and if so, return AE_ERROR.
Signed-off-by: Kangjie Lu <kjlu@....edu>
---
drivers/char/hpet.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index d0ad85900b79..3a1e6b3ccd10 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -973,6 +973,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
if (ACPI_SUCCESS(status)) {
hdp->hd_phys_address = addr.address.minimum;
hdp->hd_address = ioremap(addr.address.minimum, addr.address.address_length);
+ if (!hdp->hd_address)
+ return AE_ERROR;
if (hpet_is_known(hdp)) {
iounmap(hdp->hd_address);
--
2.17.1
Powered by blists - more mailing lists