dpaa2-mac: fix the remove path for non-MAC interfaces
authorIoana Ciornei <ioana.ciornei@nxp.com>
Mon, 11 Jan 2021 17:18:02 +0000 (19:18 +0200)
committerIoana Ciornei <ciorneiioana@gmail.com>
Mon, 26 Apr 2021 09:22:47 +0000 (12:22 +0300)
commit1c1351d1a9b0e10e313d111ac78b7c18fb607d31
tree1f772953d1b90bafc5df29c0faa88610cb59a0e0
parent89d9b7a9780234d758058beb67add1cba3bbea16
dpaa2-mac: fix the remove path for non-MAC interfaces

Check if the interface is indeed connected to a MAC before trying to
close the DPMAC object representing it. Without this check we end up
working with a NULL pointer.

Fixes: d87e606373f6 ("dpaa2-mac: export MAC counters even when in TYPE_FIXED")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20210111171802.1826324-1-ciorneiioana@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c