[dpdk-dev,v5,6/6] i40e: check rxq parameter in i40e_reset_rx_queue
diff mbox

Message ID 1434733442-32013-7-git-send-email-bernard.iremonger@intel.com
State Superseded, archived
Headers show

Commit Message

Iremonger, Bernard June 19, 2015, 5:04 p.m. UTC
There is a segmentation fault if rxq is NULL

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

Patch
diff mbox

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);