Skip to content

Commit

Permalink
char: hpet: fix a missing check of ioremap
Browse files Browse the repository at this point in the history
Check if ioremap fails, and if so, return AE_ERROR.

Signed-off-by: Kangjie Lu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
kengiter authored and gregkh committed Mar 27, 2019
1 parent d8fb3fa commit 13bd14a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 13bd14a

Please sign in to comment.