rswitch: Fix renesas_eth_sw_remove() implementation
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tue, 10 Oct 2023 12:48:57 +0000 (21:48 +0900)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 12 Oct 2023 09:22:21 +0000 (11:22 +0200)
commit510b18cf23b9bd8a982ef7f1fb19f3968a2bf787
tree38ae3d0f83dd5dff2c8d14ade1b57f3f0b7425d8
parent50e492143374c17ad89c865a1a44837b3f5c8226
rswitch: Fix renesas_eth_sw_remove() implementation

Fix functions calling order and a condition in renesas_eth_sw_remove().
Otherwise, kernel NULL pointer dereference happens from phy_stop() if
a net device opens.

Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/renesas/rswitch.c