net: sgi: ioc3-eth: check return value after calling platform_get_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 9 Jun 2021 13:25:15 +0000 (21:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:49 +0000 (09:44 +0200)
commitfb3b4bcdd3bc1f1ca1e13650ceeed7ed37fe7ad1
treec8ced9f895ccc52facd991b9e671c3cc73b90c6c
parente613f67f1b518df102bf56241188b71cdbeb9a50
net: sgi: ioc3-eth: check return value after calling platform_get_resource()

[ Upstream commit db8f7be1e1d64fbf113a456ef94534fbf5e9a9af ]

It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/sgi/ioc3-eth.c