net: mvpp2: fix possible invalid pointer dereference
authorHui Tang <tanghui20@huawei.com>
Thu, 17 Nov 2022 08:40:32 +0000 (16:40 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 19 Nov 2022 03:38:59 +0000 (19:38 -0800)
commitcbe867685386af1f0a2648f5279f6e4c74bfd17f
treec6e16e470b10c9ab49825443ea183d29dea31d07
parent594c61ffc77de0a197934aa0f1df9285c68801c6
net: mvpp2: fix possible invalid pointer dereference

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>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c