Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1240500

[PATCH v3 2/5] net: dsa: add missing dsa_switch mdiobus remove

From Neil Armstrong <narmstrong@baylibre.com>
Newsgroups linux.kernel
Subject [PATCH v3 2/5] net: dsa: add missing dsa_switch mdiobus remove
Date 2015-10-06 16:50 +0200
Message-ID <qgBIZ-Em-13@gated-at.bofh.it> (permalink)
Organization Baylibre

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v3 2/5] net: dsa: add missing dsa_switch mdiobus remove Neil Armstrong <narmstrong@baylibre.com> - 2015-10-06 16:50 +0200

csiph-web