From: Tomasz Duszynski Date: Mon, 4 Jun 2018 09:24:28 +0000 (+0200) Subject: net/mvpp2: check pointer before using it X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=42ab8427d4c67532df0b91b8e55e695f8c4f3bb6;p=dpdk.git net/mvpp2: check pointer before using it Avoid NULL dereference by checking pointer before using it. Note that the fixes tag is before the driver was renamed to mvpp2, so the patch will not apply that far back. Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation") Signed-off-by: Tomasz Duszynski --- diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index ae8804a02a..d5eb1fe69c 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -1614,9 +1614,12 @@ mrvl_rx_queue_release(void *rxq) if (core_id == LCORE_ID_ANY) core_id = 0; + if (!q) + return; + hif = mrvl_get_hif(q->priv, core_id); - if (!q || !hif) + if (!hif) return; tc = q->priv->rxq_map[q->queue_id].tc;