net/bnxt: fix freeing all VNICs during port stop
[dpdk.git] / drivers / net / bnxt / bnxt_vnic.c
index 52a4bad..104342e 100644 (file)
@@ -75,12 +75,13 @@ struct bnxt_vnic_info *bnxt_alloc_vnic(struct bnxt *bp)
 
 void bnxt_free_all_vnics(struct bnxt *bp)
 {
-       struct bnxt_vnic_info *temp;
+       struct bnxt_vnic_info *vnic;
        unsigned int i;
 
-       for (i = 0; i < bp->nr_vnics; i++) {
-               temp = &bp->vnic_info[i];
-               STAILQ_INSERT_TAIL(&bp->free_vnic_list, temp, next);
+       for (i = 0; i < bp->max_vnics; i++) {
+               vnic = &bp->vnic_info[i];
+               STAILQ_INSERT_TAIL(&bp->free_vnic_list, vnic, next);
+               vnic->rx_queue_cnt = 0;
        }
 }