aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/igb/igb_main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index a9f4e0288409..ab7c5e97ed02 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -649,6 +649,8 @@ static void igb_free_q_vectors(struct igb_adapter *adapter)
649 for (v_idx = 0; v_idx < adapter->num_q_vectors; v_idx++) { 649 for (v_idx = 0; v_idx < adapter->num_q_vectors; v_idx++) {
650 struct igb_q_vector *q_vector = adapter->q_vector[v_idx]; 650 struct igb_q_vector *q_vector = adapter->q_vector[v_idx];
651 adapter->q_vector[v_idx] = NULL; 651 adapter->q_vector[v_idx] = NULL;
652 if (!q_vector)
653 continue;
652 netif_napi_del(&q_vector->napi); 654 netif_napi_del(&q_vector->napi);
653 kfree(q_vector); 655 kfree(q_vector);
654 } 656 }
@@ -768,13 +770,7 @@ static int igb_alloc_q_vectors(struct igb_adapter *adapter)
768 return 0; 770 return 0;
769 771
770err_out: 772err_out:
771 while (v_idx) { 773 igb_free_q_vectors(adapter);
772 v_idx--;
773 q_vector = adapter->q_vector[v_idx];
774 netif_napi_del(&q_vector->napi);
775 kfree(q_vector);
776 adapter->q_vector[v_idx] = NULL;
777 }
778 return -ENOMEM; 774 return -ENOMEM;
779} 775}
780 776