Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933919AbXKPTW5 (ORCPT ); Fri, 16 Nov 2007 14:22:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764949AbXKPTV5 (ORCPT ); Fri, 16 Nov 2007 14:21:57 -0500 Received: from stargate.chelsio.com ([12.22.49.110]:11569 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764513AbXKPTVz (ORCPT ); Fri, 16 Nov 2007 14:21:55 -0500 From: Divy Le Ray Subject: [PATCH 3/9] cxgb3 - Fix resources release. To: jeff@garzik.org Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, swise@opengridcomputing.com, wenxiong@us.ibm.com Date: Fri, 16 Nov 2007 11:21:50 -0800 Message-ID: <20071116192150.31060.44605.stgit@speedy5> User-Agent: StGIT/0.12 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1380 Lines: 41 From: Divy Le Ray Remove sysfs entries before unregistering the net devices. Signed-off-by: Divy Le Ray --- drivers/net/cxgb3/cxgb3_main.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index d92da8f..9d14652 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c @@ -2585,10 +2585,6 @@ static void __devexit remove_one(struct pci_dev *pdev) sysfs_remove_group(&adapter->port[0]->dev.kobj, &cxgb3_attr_group); - for_each_port(adapter, i) - if (test_bit(i, &adapter->registered_device_map)) - unregister_netdev(adapter->port[i]); - if (is_offload(adapter)) { cxgb3_adapter_unofld(adapter); if (test_bit(OFFLOAD_DEVMAP_BIT, @@ -2596,6 +2592,10 @@ static void __devexit remove_one(struct pci_dev *pdev) offload_close(&adapter->tdev); } + for_each_port(adapter, i) + if (test_bit(i, &adapter->registered_device_map)) + unregister_netdev(adapter->port[i]); + t3_free_sge_resources(adapter); cxgb_disable_msi(adapter); - 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/