summaryrefslogtreecommitdiffstats
path: root/drivers/char/hpet.c
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-08 21:50:24 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-28 02:15:51 +0900
commit13bd14a41ce3105d5b1f3cd8b4d1e249d17b6d9b (patch)
treedd160bbc57183d3b001cea70d31726ed2f9fffc6 /drivers/char/hpet.c
parentd8fb3fafa220035a8fc6af9822ab6f591ca83a57 (diff)
downloadlinux-13bd14a41ce3105d5b1f3cd8b4d1e249d17b6d9b.tar.gz
linux-13bd14a41ce3105d5b1f3cd8b4d1e249d17b6d9b.tar.bz2
linux-13bd14a41ce3105d5b1f3cd8b4d1e249d17b6d9b.zip
char: hpet: fix a missing check of ioremap
Check if ioremap fails, and if so, return AE_ERROR. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/hpet.c')
-rw-r--r--drivers/char/hpet.c2
1 files changed, 2 insertions, 0 deletions
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);