]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: fujitsu: fix potential null-ptr-deref
authorAnirudh Rayabharam <mail@anirudhrb.com>
Mon, 3 May 2021 11:56:42 +0000 (13:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 06:22:07 +0000 (08:22 +0200)
commitb92170e209f7746ed72eaac98f2c2f4b9af734e6
treebf139152d051ea065a43f22e3bde4ed53d82e600
parentcf5502e81afe9d7a4abad999c79eb54d53316c2e
net: fujitsu: fix potential null-ptr-deref

[ Upstream commit 52202be1cd996cde6e8969a128dc27ee45a7cb5e ]

In fmvj18x_get_hwinfo(), if ioremap fails there will be NULL pointer
deref. To fix this, check the return value of ioremap and return -1
to the caller in case of failure.

Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com>
Link: https://lore.kernel.org/r/20210503115736.2104747-16-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/fujitsu/fmvj18x_cs.c