From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9B98A052A; Tue, 2 Feb 2021 08:36:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D813240284; Tue, 2 Feb 2021 08:36:12 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 8E41E24027A for ; Tue, 2 Feb 2021 08:36:10 +0100 (CET) IronPort-SDR: 39D5VofRx+WUNz+REBpjife0zW5CiTMB60Q4KXfiA8ugGcJWH8wOnM9JoYqHqWSRn7R+M5u506 nDT9YKDkXuxg== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="168490926" X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="168490926" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 23:36:08 -0800 IronPort-SDR: LrWYMulbCZWHYD0UF9u4PNyoV45Ng4iiQevNWFaVKZqoH4j0U+Fyxnk+ir6IEav7j8WgNNp57k J88jRFFRe1tg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="413059039" Received: from dpdk_jiangcheng.sh.intel.com ([10.67.119.112]) by FMSMGA003.fm.intel.com with ESMTP; 01 Feb 2021 23:36:06 -0800 From: Cheng Jiang To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, yvonnex.yang@intel.com, Cheng Jiang Date: Tue, 2 Feb 2021 07:24:21 +0000 Message-Id: <20210202072421.15890-1-Cheng1.jiang@intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202062830.4490-1-Cheng1.jiang@intel.com> References: <20210202062830.4490-1-Cheng1.jiang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] examples/vhost: fix potentially overflowing expression X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Change the type of buff_idx from uint64_t to uint32_t to fix coverity issue. Coverity issue: 366264 Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path") Signed-off-by: Cheng Jiang --- v2: fixed the format of git log examples/vhost/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 233a2dc6e..e74fc8750 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -864,7 +864,7 @@ static __rte_always_inline void drain_vhost(struct vhost_dev *vdev) { uint16_t ret; - uint64_t buff_idx = rte_lcore_id() * MAX_VHOST_DEVICE + vdev->vid; + uint32_t buff_idx = rte_lcore_id() * MAX_VHOST_DEVICE + vdev->vid; uint16_t nr_xmit = vhost_txbuff[buff_idx]->len; struct rte_mbuf **m = vhost_txbuff[buff_idx]->m_table; -- 2.29.2