net: mvpp2: fix possible invalid pointer dereference
authorHui Tang <tanghui20@huawei.com>
Thu, 17 Nov 2022 08:40:32 +0000 (16:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:05 +0000 (17:41 +0100)
commita8976074e2cb2ad943bd0da8160a02ebe89be6b8
tree176ee07b9b9f96d8104f18c028a8e6611c420a81
parent3a4cc56cd17d3f17053ef061ca9be356b2bf8aaa
net: mvpp2: fix possible invalid pointer dereference

[ Upstream commit cbe867685386af1f0a2648f5279f6e4c74bfd17f ]

It will cause invalid pointer dereference to priv->cm3_base behind,
if PTR_ERR(priv->cm3_base) in mvpp2_get_sram().

Fixes: e54ad1e01c00 ("net: mvpp2: add CM3 SRAM memory map")
Signed-off-by: Hui Tang <tanghui20@huawei.com>
Link: https://lore.kernel.org/r/20221117084032.101144-1-tanghui20@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c