* [PATCH v3 2/5] net: dsa: add missing dsa_switch mdiobus remove
@ 2015-10-06 14:40 Neil Armstrong
0 siblings, 0 replies; only message in thread
From: Neil Armstrong @ 2015-10-06 14:40 UTC (permalink / raw)
To: David S. Miller, Florian Fainelli, Guenter Roeck, vivien.didelot,
Andrew Lunn, Fabian Frederick, Pavel Nakonechny, Joe Perches,
netdev, linux-kernel, nbd, sergei.shtylyov
To prevent memory leakage on unbinding, add missing mdiobus unregister
and unallocation calls.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
net/dsa/dsa.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index ed9d43f..14fac4e 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -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
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-06 14:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06 14:40 [PATCH v3 2/5] net: dsa: add missing dsa_switch mdiobus remove Neil Armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).