]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit0cc3552bcf13246901be0ea75714d9ec21f9abff
tree07af22bc66b8fe9d2d3f27cf233eb1e02a609f73
parent9996d80fc0355046b6b0731b6dc2f70a2bfc565c
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