diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2019-11-02 23:17:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-05 20:54:59 -0500 |
commit | e684000b8a2b1e14b9f8ebd72dfd998d44a864ca (patch) | |
tree | 43d0f844fb34ceefa1edfe375d91e6dc07d79ebb | |
parent | 59eb87cb52c9f7164804bc8639c4d03ba9b0c169 (diff) |
net: dsa: bcm_sf2: Fix driver removal
With the DSA core doing the call to dsa_port_disable() we do not need to
do that within the driver itself. This could cause an use after free
since past dsa_unregister_switch() we should not be accessing any
dsa_switch internal structures.
Fixes: 0394a63acfe2 ("net: dsa: enable and disable all ports")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index d44651ad520c..69fc13046ac7 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c | |||
@@ -1215,10 +1215,10 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev) | |||
1215 | struct bcm_sf2_priv *priv = platform_get_drvdata(pdev); | 1215 | struct bcm_sf2_priv *priv = platform_get_drvdata(pdev); |
1216 | 1216 | ||
1217 | priv->wol_ports_mask = 0; | 1217 | priv->wol_ports_mask = 0; |
1218 | /* Disable interrupts */ | ||
1219 | bcm_sf2_intr_disable(priv); | ||
1218 | dsa_unregister_switch(priv->dev->ds); | 1220 | dsa_unregister_switch(priv->dev->ds); |
1219 | bcm_sf2_cfp_exit(priv->dev->ds); | 1221 | bcm_sf2_cfp_exit(priv->dev->ds); |
1220 | /* Disable all ports and interrupts */ | ||
1221 | bcm_sf2_sw_suspend(priv->dev->ds); | ||
1222 | bcm_sf2_mdio_unregister(priv); | 1222 | bcm_sf2_mdio_unregister(priv); |
1223 | 1223 | ||
1224 | return 0; | 1224 | return 0; |