app/bbdev: fix unchecked return value
authorKamil Chalupnik <kamilx.chalupnik@intel.com>
Wed, 16 May 2018 13:57:14 +0000 (15:57 +0200)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Tue, 22 May 2018 14:36:11 +0000 (16:36 +0200)
Fixing CHECKED_RETURN issue by checking values returned
by rte_bbdev_dec_op_alloc_bulk and rte_bbdev_enc_op_alloc_bulk
functions.

Coverity issue: 279447, 279456
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Cc: stable@dpdk.org
Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
app/test-bbdev/test_bbdev_perf.c

index ca162d9..6861edc 100644 (file)
@@ -1731,7 +1731,9 @@ latency_test_dec(struct rte_mempool *mempool,
                if (unlikely(num_to_process - dequeued < burst_sz))
                        burst_sz = num_to_process - dequeued;
 
-               rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+               ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+               TEST_ASSERT_SUCCESS(ret,
+                               "rte_bbdev_dec_op_alloc_bulk() failed");
                if (test_vector.op_type != RTE_BBDEV_OP_NONE)
                        copy_reference_dec_op(ops_enq, burst_sz, dequeued,
                                        bufs->inputs,
@@ -1798,7 +1800,9 @@ latency_test_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_enc_op_alloc_bulk() failed");
                if (test_vector.op_type != RTE_BBDEV_OP_NONE)
                        copy_reference_enc_op(ops_enq, burst_sz, dequeued,
                                        bufs->inputs,