app/bbdev: fix bulk allocation checks
authorNicolas Chautru <nicolas.chautru@intel.com>
Tue, 6 Aug 2019 14:09:00 +0000 (07:09 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 6 Aug 2019 21:36:34 +0000 (23:36 +0200)
Returned value from rte_bbdev_enc_op_alloc_bulk not checked consistently.

Coverity issue: 344986
Fixes: d819c08327f3 ("app/bbdev: update for 5GNR")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
app/test-bbdev/test_bbdev_perf.c

index a166eaf..7ab61ef 100644 (file)
@@ -3163,7 +3163,8 @@ offload_latency_test_enc(struct rte_mempool *mempool, struct test_buffers *bufs,
                if (unlikely(num_to_process - dequeued < burst_sz))
                        burst_sz = num_to_process - dequeued;
 
-               rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);
+               ret = rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);
+               TEST_ASSERT_SUCCESS(ret, "rte_bbdev_op_alloc_bulk() failed");
                if (test_vector.op_type != RTE_BBDEV_OP_NONE)
                        copy_reference_enc_op(ops_enq, burst_sz, dequeued,
                                        bufs->inputs,
@@ -3244,7 +3245,8 @@ offload_latency_test_ldpc_enc(struct rte_mempool *mempool,
                if (unlikely(num_to_process - dequeued < burst_sz))
                        burst_sz = num_to_process - dequeued;
 
-               rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);
+               ret = rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);
+               TEST_ASSERT_SUCCESS(ret, "rte_bbdev_op_alloc_bulk() failed");
                if (test_vector.op_type != RTE_BBDEV_OP_NONE)
                        copy_reference_ldpc_enc_op(ops_enq, burst_sz, dequeued,
                                        bufs->inputs,