i40e: check Rx queue parameter when resetting
authorBernard Iremonger <bernard.iremonger@intel.com>
Fri, 3 Jul 2015 14:03:59 +0000 (15:03 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 19 Jul 2015 19:33:58 +0000 (21:33 +0200)
There is a segmentation fault if rxq is NULL.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
drivers/net/i40e/i40e_rxtx.c

index 2ced081..be0d9a0 100644 (file)
@@ -2886,6 +2886,11 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq)
        unsigned i;
        uint16_t len;
 
+       if (!rxq) {
+               PMD_DRV_LOG(DEBUG, "Pointer to rxq is NULL");
+               return;
+       }
+
 #ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
        if (check_rx_burst_bulk_alloc_preconditions(rxq) == 0)
                len = (uint16_t)(rxq->nb_rx_desc + RTE_PMD_I40E_RX_MAX_BURST);