From: Hernan Vargas <hernan.vargas@intel.com>
To: dev@dpdk.org, gakhil@marvell.com, trix@redhat.com,
maxime.coquelin@redhat.com
Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com,
john.mcnamara@intel.com, Hernan Vargas <hernan.vargas@intel.com>,
stable@dpdk.org
Subject: [PATCH v1 1/2] test/bbdev: fix possible div by zero issue
Date: Wed, 8 Mar 2023 19:36:23 -0800 [thread overview]
Message-ID: <20230309033624.61660-2-hernan.vargas@intel.com> (raw)
In-Reply-To: <20230309033624.61660-1-hernan.vargas@intel.com>
Add extra check at function level to ensure num_ops cannot be 0.
Coverity issue: 383647
Fixes: f0d288bca467 ("test/bbdev: add support for BLER for 4G")
Cc: stable@dpdk.org
Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
app/test-bbdev/test_bbdev_perf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index e56d314e93b5..15ebcdfc1556 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3722,6 +3722,7 @@ bler_pmd_lcore_ldpc_dec(void *arg)
TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
"BURST_SIZE should be <= %u", MAX_BURST);
+ TEST_ASSERT_SUCCESS((num_ops == 0), "NUM_OPS must be greater than 0");
rte_bbdev_info_get(tp->dev_id, &info);
@@ -3856,6 +3857,7 @@ bler_pmd_lcore_turbo_dec(void *arg)
TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
"BURST_SIZE should be <= %u", MAX_BURST);
+ TEST_ASSERT_SUCCESS((num_ops == 0), "NUM_OPS must be greater than 0");
rte_bbdev_info_get(tp->dev_id, &info);
--
2.37.1
next prev parent reply other threads:[~2023-03-09 3:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 3:36 [PATCH v1 0/2] test-bbdev coverity fixes Hernan Vargas
2023-03-09 3:36 ` Hernan Vargas [this message]
2023-03-16 14:09 ` [PATCH v1 1/2] test/bbdev: fix possible div by zero issue Maxime Coquelin
2023-03-09 3:36 ` [PATCH v1 2/2] test/bbdev: fix unchecked ret value issue Hernan Vargas
2023-03-16 14:10 ` Maxime Coquelin
2023-03-16 14:29 ` [PATCH v1 0/2] test-bbdev coverity fixes Maxime Coquelin
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=20230309033624.61660-2-hernan.vargas@intel.com \
--to=hernan.vargas@intel.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=john.mcnamara@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=nicolas.chautru@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=stable@dpdk.org \
--cc=trix@redhat.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).