]> git.baikalelectronics.ru Git - kernel.git/commit
net: fman: Unregister ethernet device on removal
authorSean Anderson <sean.anderson@seco.com>
Thu, 3 Nov 2022 18:28:30 +0000 (14:28 -0400)
committerJakub Kicinski <kuba@kernel.org>
Sat, 5 Nov 2022 02:33:38 +0000 (19:33 -0700)
commitb46bec6ae9817c2ed3c425213b1ee729c42576b6
tree289cf0e154202ba526d62c472407b00cb56ee3c5
parent3366f566c5d7dac6c3a910c2c8da63888ba31e4b
net: fman: Unregister ethernet device on removal

When the mac device gets removed, it leaves behind the ethernet device.
This will result in a segfault next time the ethernet device accesses
mac_dev. Remove the ethernet device when we get removed to prevent
this. This is not completely reversible, since some resources aren't
cleaned up properly, but that can be addressed later.

Fixes: 64bd9b934c01 ("fsl/fman: Add FMan MAC driver")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20221103182831.2248833-1-sean.anderson@seco.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/fman/mac.c