diff mbox

[dpdk-dev] app/testbbdev: fix unchecked return value

Message ID 20180516135714.37352-1-kamilx.chalupnik@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Kamil Chalupnik May 16, 2018, 1:57 p.m. UTC
Fixing CHECKED_RETURN issue by checking values returned
by rte_bbdev_dec_op_alloc_bulk and rte_bbdev_enc_op_alloc_bulk
functions.

Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Coverity issue: 279447, 279456

Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Mokhtar, Amr May 17, 2018, 12:40 p.m. UTC | #1
> -----Original Message-----
> From: Chalupnik, KamilX
> Sent: Wednesday 16 May 2018 14:57
> To: Mokhtar, Amr <amr.mokhtar@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Chalupnik, KamilX <kamilx.chalupnik@intel.com>
> Subject: [PATCH] app/testbbdev: fix unchecked return value
> 
> Fixing CHECKED_RETURN issue by checking values returned
> by rte_bbdev_dec_op_alloc_bulk and rte_bbdev_enc_op_alloc_bulk
> functions.
> 
> Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
> Coverity issue: 279447, 279456
> 
> Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>

Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
De Lara Guarch, Pablo May 17, 2018, 4:15 p.m. UTC | #2
> -----Original Message-----
> From: Mokhtar, Amr
> Sent: Thursday, May 17, 2018 1:41 PM
> To: Chalupnik, KamilX <kamilx.chalupnik@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] app/testbbdev: fix unchecked return value
> 
> 
> > -----Original Message-----
> > From: Chalupnik, KamilX
> > Sent: Wednesday 16 May 2018 14:57
> > To: Mokhtar, Amr <amr.mokhtar@intel.com>; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch@intel.com>
> > Cc: dev@dpdk.org; Chalupnik, KamilX <kamilx.chalupnik@intel.com>
> > Subject: [PATCH] app/testbbdev: fix unchecked return value
> >
> > Fixing CHECKED_RETURN issue by checking values returned by
> > rte_bbdev_dec_op_alloc_bulk and rte_bbdev_enc_op_alloc_bulk functions.
> >
> > Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
> > Coverity issue: 279447, 279456

Added Cc: stable@dpdk.org

> >
> > Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
> 
> Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>

Applied to dpdk-next-crypto.

By the way, could you change your author name to Kamil Chalupnik,
to match your "Signed-off-by:" line.

Thanks,
Pablo
diff mbox

Patch

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index ca162d9..6861edc 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -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,