char: hpet: add checks after calling ioremap
authorTom Seewald <tseewald@gmail.com>
Mon, 3 May 2021 11:56:56 +0000 (13:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 06:36:21 +0000 (08:36 +0200)
commit48003177438d95c4b1d1ed2fdfd571b9a5501447
tree1d7231d3c05c919ab8b32fa0ee2cd50d390cc877
parented116a0f171db2736f246cf41faa7a50d78cd3ea
char: hpet: add checks after calling ioremap

[ 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