All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] char: hpet: fix a missing check of ioremap
@ 2019-03-09  3:50 Kangjie Lu
  0 siblings, 0 replies; only message in thread
From: Kangjie Lu @ 2019-03-09  3:50 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
	linux-kernel

Check if ioremap fails, and if so, return AE_ERROR.

Signed-off-by: Kangjie Lu <kjlu@umn.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


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

only message in thread, other threads:[~2019-03-09  3:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-09  3:50 [PATCH] char: hpet: fix a missing check of ioremap Kangjie Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.