lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <56321DCD.3070702@baylibre.com>
Date:	Thu, 29 Oct 2015 14:23:25 +0100
From:	Neil Armstrong <narmstrong@...libre.com>
To:	"David S. Miller" <davem@...emloft.net>
Cc:	Andrew Lunn <andrew@...n.ch>,
	Florian Fainelli <f.fainelli@...il.com>,
	Guenter Roeck <linux@...ck-us.net>,
	vivien.didelot@...oirfairelinux.com,
	Fabian Frederick <fabf@...net.be>,
	Pavel Nakonechny <pavel.nakonechny@...tlab.ru>,
	Joe Perches <joe@...ches.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, Frode Isaksen <fisaksen@...libre.com>
Subject: [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy

Add missing netif_carrier_off and phy_disconnect calls to the
dsa_switch_destroy function to make sure the netdev and phy
ressources are clean before complete removal.

Signed-off-by: Frode Isaksen <fisaksen@...libre.com>
Signed-off-by: Neil Armstrong <narmstrong@...libre.com>
---
 net/dsa/dsa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 597a462..11452e4 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -454,7 +454,9 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
 		if (!ds->ports[port])
 			continue;

+		netif_carrier_off(ds->ports[port]);
 		unregister_netdev(ds->ports[port]);
+		phy_disconnect(p->phy);
 		free_netdev(ds->ports[port]);
 	}

-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ