There is a segmentation fault if rxq is NULL

Changes in V4:
This patch added.

Signed-off-by: Bernard Iremonger <bernard.iremonger at intel.com>
---
 drivers/net/i40e/i40e_rxtx.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 2de0ac4..2a89e84 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2269,6 +2269,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);
-- 
1.7.4.1

Reply via email to