aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2015-10-06 15:40:25 +0100
committerDavid S. Miller <davem@davemloft.net>2015-10-07 04:56:07 -0700
commite410ddb89ee8e68103ea58938b4972da594e3d2d (patch)
tree7c45ef34a509f1d1bba2e0ab8d892ab0ed0a07a4 /net/dsa
parentnet: dsa: add missing kfree on remove (diff)
downloadlinux-dev-e410ddb89ee8e68103ea58938b4972da594e3d2d.tar.xz
linux-dev-e410ddb89ee8e68103ea58938b4972da594e3d2d.zip
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')
-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