From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964987AbbJ2NXg (ORCPT ); Thu, 29 Oct 2015 09:23:36 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:33188 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932554AbbJ2NXc (ORCPT ); Thu, 29 Oct 2015 09:23:32 -0400 From: Neil Armstrong Subject: [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy To: "David S. Miller" Cc: Andrew Lunn , Florian Fainelli , Guenter Roeck , vivien.didelot@savoirfairelinux.com, Fabian Frederick , Pavel Nakonechny , Joe Perches , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Frode Isaksen Organization: Baylibre Message-ID: <56321DCD.3070702@baylibre.com> Date: Thu, 29 Oct 2015 14:23:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Neil Armstrong --- 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