summaryrefslogtreecommitdiff
path: root/net/dsa/dsa.c
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2015-10-06 17:40:25 +0300
committerDavid S. Miller <davem@davemloft.net>2015-10-07 14:56:07 +0300
commite410ddb89ee8e68103ea58938b4972da594e3d2d (patch)
tree7c45ef34a509f1d1bba2e0ab8d892ab0ed0a07a4 /net/dsa/dsa.c
parent1023d2ec1e8bd63ede9ed1d93ebb797f650859b7 (diff)
downloadlinux-e410ddb89ee8e68103ea58938b4972da594e3d2d.tar.xz
net: dsa: add missing dsa_switch mdiobus remove
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r--net/dsa/dsa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index ed9d43fd1fec..14fac4ed9569 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