DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mvpp2: check pointer before using it
@ 2018-06-04  9:24 Tomasz Duszynski
  2018-06-05 16:17 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Duszynski @ 2018-06-04  9:24 UTC (permalink / raw)
  To: dev; +Cc: nsamsono, jianbo.liu, dima, mw, Tomasz Duszynski

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>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mvpp2: check pointer before using it
  2018-06-04  9:24 [dpdk-dev] [PATCH] net/mvpp2: check pointer before using it Tomasz Duszynski
@ 2018-06-05 16:17 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2018-06-05 16:17 UTC (permalink / raw)
  To: Tomasz Duszynski, dev; +Cc: nsamsono, jianbo.liu, dima, mw

On 6/4/2018 10:24 AM, Tomasz Duszynski wrote:
> 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>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-05 16:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-04  9:24 [dpdk-dev] [PATCH] net/mvpp2: check pointer before using it Tomasz Duszynski
2018-06-05 16:17 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).