[3/4] event/dlb2: fix dereference NULL pointer Coverity warning
Checks
Commit Message
Add NULL check before using t->mbuf_pool.
Fixes: 6f1b828 ("event/dlb2: add self-tests")
Coverity issue: 363719
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
drivers/event/dlb2/dlb2_selftest.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -212,7 +212,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,