projects
/
wrapfs-4.13.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
48ac9e4
)
char: hpet: add checks after calling ioremap
author
Tom Seewald
<tseewald@gmail.com>
Mon, 3 May 2021 11:56:56 +0000
(13:56 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 06:38:09 +0000
(08:38 +0200)
[ Upstream commit
b11701c933112d49b808dee01cb7ff854ba6a77a
]
The function hpet_resources() calls ioremap() two times, but in both
cases it does not check if ioremap() returned a null pointer. Fix this
by adding null pointer checks and returning an appropriate error.
Signed-off-by: Tom Seewald <tseewald@gmail.com>
Link:
https://lore.kernel.org/r/20210503115736.2104747-30-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/hpet.c
patch
|
blob
|
history
diff --git
a/drivers/char/hpet.c
b/drivers/char/hpet.c
index c0732f032248479fb6ea2386ec76bb46e3800798..68f02318cee32dc280acc1cfe367327197174cfb 100644
(file)
--- a/
drivers/char/hpet.c
+++ b/
drivers/char/hpet.c
@@
-975,6
+975,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);
@@
-988,6
+990,8
@@
static acpi_status hpet_resources(struct acpi_resource *res, void *data)
hdp->hd_phys_address = fixmem32->address;
hdp->hd_address = ioremap(fixmem32->address,
HPET_RANGE_SIZE);
+ if (!hdp->hd_address)
+ return AE_ERROR;
if (hpet_is_known(hdp)) {
iounmap(hdp->hd_address);