From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 988C6A0535; Tue, 4 Feb 2020 17:10:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D06C1C206; Tue, 4 Feb 2020 17:10:14 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3E8FE1C1C7; Tue, 4 Feb 2020 17:10:12 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2020 08:10:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,402,1574150400"; d="scan'208";a="378456880" Received: from silpixa00399953.ir.intel.com (HELO silpixa00399953.ger.corp.intel.com) ([10.237.222.53]) by orsmga004.jf.intel.com with ESMTP; 04 Feb 2020 08:10:09 -0800 From: Ciara Power To: bruce.richardson@intel.com Cc: dev@dpdk.org, Ciara Power , stable@dpdk.org Date: Tue, 4 Feb 2020 16:00:06 +0000 Message-Id: <20200204160006.64720-1-ciara.power@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] examples/ioat: fix failure check for ioat dequeue 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The nb_dq return value from the ioat dequeue is negative in failure cases, however the variable was an unsigned int, causing the condition where nb_dq <= 0 to never be true. This is now cast to a signed int, which will successfully reflect the -1 value to be used in this conditional check. Coverity issue: 350342 Coverity issue: 350349 Fixes: 92c981637ffc ("examples/ioat: handle failure case for ioat dequeue") Cc: bruce.richardson@intel.com Cc: stable@dpdk.org Signed-off-by: Ciara Power --- examples/ioat/ioatfwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index e9117718f..f460a5c92 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -460,7 +460,7 @@ ioat_tx_port(struct rxtx_port_config *tx_config) MAX_PKT_BURST, NULL); } - if (nb_dq <= 0) + if ((int32_t) nb_dq <= 0) return; if (copy_mode == COPY_MODE_IOAT_NUM) -- 2.17.1