From: Neil Armstrong Date: Tue, 6 Oct 2015 14:40:25 +0000 (+0100) Subject: net: dsa: add missing dsa_switch mdiobus remove X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e410ddb89ee8e68103ea58938b4972da594e3d2d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Neil Armstrong Signed-off-by: David S. Miller --- 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