i40e: delete netdev after deleting napi and vectors
authorShannon Nelson <shannon.nelson@intel.com>
Tue, 11 Feb 2014 08:24:07 +0000 (08:24 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 14 Mar 2014 23:29:15 +0000 (16:29 -0700)
We've been deleting the netdev before getting around to deleting the napi
structs.  Unfortunately, we then didn't delete the napi structs because we
have a check for netdev, thus we were leaving garbage around in the system.

Change-ID: Ife540176f6c9f801147495b3f2d2ac2e61ddcc58
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 43d391bb65c4e4d9fe421dee321587e57abf238f..a3f122eb9f7e819eea329bed7a3f9ed7c744c661 100644 (file)
@@ -6806,8 +6806,6 @@ int i40e_vsi_release(struct i40e_vsi *vsi)
                        if (vsi->netdev) {
                                /* results in a call to i40e_close() */
                                unregister_netdev(vsi->netdev);
-                               free_netdev(vsi->netdev);
-                               vsi->netdev = NULL;
                        }
                } else {
                        if (!test_and_set_bit(__I40E_DOWN, &vsi->state))
@@ -6826,6 +6824,10 @@ int i40e_vsi_release(struct i40e_vsi *vsi)
 
        i40e_vsi_delete(vsi);
        i40e_vsi_free_q_vectors(vsi);
+       if (vsi->netdev) {
+               free_netdev(vsi->netdev);
+               vsi->netdev = NULL;
+       }
        i40e_vsi_clear_rings(vsi);
        i40e_vsi_clear(vsi);