i40evf: remove dead code
authorAlan Cox <alan@linux.intel.com>
Wed, 2 Mar 2016 00:02:15 +0000 (16:02 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 5 Apr 2016 08:40:39 +0000 (01:40 -0700)
The only error case is when the malloc fails, in which case the clean up
loop does nothing at all, so remove it

Signed-off-by: Alan Cox <alan@linux.intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf_main.c

index 4b70aae2fa8406ed408036f2ba0d81c8e29a07be..820ad94c932b1848d83cec7032559a2c8e3713db 100644 (file)
@@ -1507,7 +1507,7 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)
        adapter->q_vectors = kcalloc(num_q_vectors, sizeof(*q_vector),
                                     GFP_KERNEL);
        if (!adapter->q_vectors)
-               goto err_out;
+               return -ENOMEM;
 
        for (q_idx = 0; q_idx < num_q_vectors; q_idx++) {
                q_vector = &adapter->q_vectors[q_idx];
@@ -1519,15 +1519,6 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)
        }
 
        return 0;
-
-err_out:
-       while (q_idx) {
-               q_idx--;
-               q_vector = &adapter->q_vectors[q_idx];
-               netif_napi_del(&q_vector->napi);
-       }
-       kfree(adapter->q_vectors);
-       return -ENOMEM;
 }
 
 /**