summaryrefslogtreecommitdiff
path: root/drivers/net/mvpp2
diff options
context:
space:
mode:
authorTomasz Duszynski <tdu@semihalf.com>2018-06-04 11:24:28 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-06-14 19:27:50 +0200
commit42ab8427d4c67532df0b91b8e55e695f8c4f3bb6 (patch)
treec3ac28c546c6cfced21bb1070b6fec2a1f2962e7 /drivers/net/mvpp2
parentacab7d58c81bbf100ff288e44e309891d54e0c20 (diff)
downloaddpdk-next-eventdev-42ab8427d4c67532df0b91b8e55e695f8c4f3bb6.zip
dpdk-next-eventdev-42ab8427d4c67532df0b91b8e55e695f8c4f3bb6.tar.gz
dpdk-next-eventdev-42ab8427d4c67532df0b91b8e55e695f8c4f3bb6.tar.xz
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 <tdu@semihalf.com>
Diffstat (limited to 'drivers/net/mvpp2')
-rw-r--r--drivers/net/mvpp2/mrvl_ethdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index ae8804a..d5eb1fe 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;