]> err.no Git - linux-2.6/commitdiff
cxgb3 - Fix resources release.
authorDivy Le Ray <divy@chelsio.com>
Fri, 16 Nov 2007 19:21:50 +0000 (11:21 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:04:07 +0000 (15:04 -0800)
Remove sysfs entries before unregistering the net devices.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/cxgb3/cxgb3_main.c

index d92da8fe4a506e7013e577b520dfc638856fcbdd..9d14652ffdc3c5de5998de522fefbc590c33512c 100644 (file)
@@ -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);