DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference
@ 2020-11-16 17:40 Timothy McDaniel
  2020-11-20 10:03 ` Mcnamara, John
  0 siblings, 1 reply; 3+ messages in thread
From: Timothy McDaniel @ 2020-11-16 17:40 UTC (permalink / raw)
  Cc: dev, erik.g.carrillo, gage.eads, harry.van.haaren, jerinj, thomas

Add NULL check before using t->mbuf_pool.

Coverity issue: 363719
Fixes: 83326 ("event/dlb: add PMD self-tests")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb/dlb_selftest.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/event/dlb/dlb_selftest.c b/drivers/event/dlb/dlb_selftest.c
index b9ef778c1..8ab00ba87 100644
--- a/drivers/event/dlb/dlb_selftest.c
+++ b/drivers/event/dlb/dlb_selftest.c
@@ -202,7 +202,12 @@ test_stop_flush(struct test *t) /* test to check we can properly flush events */
 		goto err;
 	}
 
-	count = rte_mempool_avail_count(t->mbuf_pool);
+	if (t->mbuf_pool)
+		count = rte_mempool_avail_count(t->mbuf_pool);
+	else {
+		printf("%d: mbuf_pool is NULL\n", __LINE__);
+		goto err;
+	}
 
 	if (rte_event_port_attr_get(evdev,
 				    0,
-- 
2.23.0


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

end of thread, other threads:[~2020-11-20 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 17:40 [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference Timothy McDaniel
2020-11-20 10:03 ` Mcnamara, John
2020-11-20 12:25   ` Jerin Jacob

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