event/dlb: fix mempool query in self test
authorTimothy McDaniel <timothy.mcdaniel@intel.com>
Mon, 16 Nov 2020 17:40:38 +0000 (11:40 -0600)
committerJerin Jacob <jerinj@marvell.com>
Fri, 20 Nov 2020 17:53:47 +0000 (18:53 +0100)
Add NULL check before using t->mbuf_pool.

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

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
drivers/event/dlb/dlb_selftest.c

index b9ef778..8ab00ba 100644 (file)
@@ -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,