dpaa2-switch: check if the port priv is valid
authorIoana Ciornei <ioana.ciornei@nxp.com>
Thu, 6 Jan 2022 13:59:05 +0000 (15:59 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 7 Jan 2022 03:49:10 +0000 (19:49 -0800)
commitd1a9b84183e818c6c3540a454d6ad278b56718b2
tree07af22bc66b8fe9d2d3f27cf233eb1e02a609f73
parent4e30e98c4b4c8c3bd2ff048e4f4bc74c8948a9fb
dpaa2-switch: check if the port priv is valid

Before accessing the port private structure make sure that there is
still a non-NULL pointer there. A NULL pointer access can happen when we
are on the remove path, some switch ports are unregistered and some are
in the process of unregistering.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c