dpaa2-eth: check fsl_mc_get_endpoint for IS_ERR_OR_NULL()
authorIoana Ciornei <ioana.ciornei@nxp.com>
Tue, 14 Jul 2020 12:08:16 +0000 (15:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:41 +0000 (10:19 +0200)
commit0db513ac27c9057908695e340b9b264967d17d4e
tree11f43097a1be6d6e2663926f0a8acdabad52efbe
parent2af940e08a2d35f3efe14ef620523eb815d9d937
dpaa2-eth: check fsl_mc_get_endpoint for IS_ERR_OR_NULL()

[ Upstream commit 841eb4012cef84820e5906527b31a854f42b0748 ]

The fsl_mc_get_endpoint() function can return an error or directly a
NULL pointer in case the peer device is not under the root DPRC
container. Treat this case also, otherwise it would lead to a NULL
pointer when trying to access the peer fsl_mc_device.

Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c