DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kamil Chalupnik <kamilx.chalupnik@intel.com>
To: amr.mokhtar@intel.com, pablo.de.lara.guarch@intel.com
Cc: dev@dpdk.org, Kamil Chalupnik <kamilx.chalupnik@intel.com>
Subject: [dpdk-dev] [PATCH] app/testbbdev: fix unchecked return value
Date: Wed, 16 May 2018 15:57:14 +0200	[thread overview]
Message-ID: <20180516135714.37352-1-kamilx.chalupnik@intel.com> (raw)

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(-)

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,
-- 
2.5.5

             reply	other threads:[~2018-05-16 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 13:57 Kamil Chalupnik [this message]
2018-05-17 12:40 ` Mokhtar, Amr
2018-05-17 16:15   ` De Lara Guarch, Pablo
  -- strict thread matches above, loose matches on Subject: below --
2018-01-31 13:54 Amr Mokhtar
2018-01-31 15:25 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180516135714.37352-1-kamilx.chalupnik@intel.com \
    --to=kamilx.chalupnik@intel.com \
    --cc=amr.mokhtar@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).