From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 95CF51B7A5 for ; Wed, 31 Jan 2018 13:56:28 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 04:56:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,440,1511856000"; d="scan'208";a="26187457" Received: from silpixa00391537.ir.intel.com (HELO silpixa00391537.ger.corp.intel.com) ([10.237.222.189]) by fmsmga004.fm.intel.com with ESMTP; 31 Jan 2018 04:56:24 -0800 From: Amr Mokhtar To: dev@dpdk.org Cc: Amr Mokhtar Date: Wed, 31 Jan 2018 12:56:21 +0000 Message-Id: <1517403381-129739-1-git-send-email-amr.mokhtar@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] app/testbbdev: fix division or modulo by float zero X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2018 12:56:29 -0000 check that iter > 0 before division Coverity issue: 257027 Coverity issue: 257038 Coverity issue: 257014 Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev") Signed-off-by: Amr Mokhtar --- app/test-bbdev/test_bbdev_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index f7b51ca..8f6896c 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -1805,7 +1805,7 @@ operation_latency_test(struct active_device *ad, op_params->ref_enc_op, ad->dev_id, queue_id, num_to_process, burst_sz, &total_time); - if (iter < 0) + if (iter <= 0) return TEST_FAILED; printf("\toperation avg. latency: %lg cycles, %lg us\n", @@ -1955,7 +1955,7 @@ offload_latency_test(struct active_device *ad, num_to_process, burst_sz, &enq_total_time, &deq_total_time); - if (iter < 0) + if (iter <= 0) return TEST_FAILED; printf("\tenq offload avg. latency: %lg cycles, %lg us\n", @@ -2047,7 +2047,7 @@ offload_latency_empty_q_test(struct active_device *ad, iter = offload_latency_empty_q_test_enc(ad->dev_id, queue_id, num_to_process, burst_sz, &deq_total_time); - if (iter < 0) + if (iter <= 0) return TEST_FAILED; printf("\tempty deq offload avg. latency: %lg cycles, %lg us\n", -- 2.7.4