diff options
author | Neil Armstrong <narmstrong@baylibre.com> | 2015-10-06 15:40:25 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-07 04:56:07 -0700 |
commit | e410ddb89ee8e68103ea58938b4972da594e3d2d (patch) | |
tree | 7c45ef34a509f1d1bba2e0ab8d892ab0ed0a07a4 | |
parent | 1023d2ec1e8bd63ede9ed1d93ebb797f650859b7 (diff) | |
download | lwn-e410ddb89ee8e68103ea58938b4972da594e3d2d.tar.gz lwn-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>
-rw-r--r-- | net/dsa/dsa.c | 2 |
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 |