]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Jul 2020 00:31:52 +0000 (17:31 -0700)
commit6f7c58b8016251dc86e1301f7bfff7bfd6560bff
tree7c7775cffe7f3623a2ef2651fbba93c99004d106
parentde3564b3ea7817e01d7d157ad5db089c06a0287f
dpaa2-eth: check fsl_mc_get_endpoint for IS_ERR_OR_NULL()

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: b96dc6eb861b ("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>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c