Skip to contentSkip to conversation

net: dsa: add missing dsa_switch mdiobus remove

PATCH In review Neil Armstrong 1 participant 1 message Oct 6, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 2/5 net: dsa: add missing dsa_switch mdiobus remove

To prevent memory leakage on unbinding, add missing mdiobus unregister and unallocation calls.

---
 net/dsa/dsa.c | 2 ++
 1 file changed, 2 insertions(+)
net/dsa/dsa.c +2 -0
index ed9d43f..14fac4e 100644
@@ -424,6 +424,8 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
 	if (ds->hwmon_dev)
 		hwmon_device_unregister(ds->hwmon_dev);
 #endif
+	mdiobus_unregister(ds->slave_mii_bus);
+	mdiobus_free(ds->slave_mii_bus);
 }
 
 #ifdef CONFIG_PM_SLEEP
Signature · 1 line
1.9.1