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 D1A00A052A; Tue, 2 Feb 2021 07:39:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D5A8240268; Tue, 2 Feb 2021 07:39:48 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id A64DC240243 for ; Tue, 2 Feb 2021 07:39:46 +0100 (CET) IronPort-SDR: Y/s6jYWW29hUOosp78HBj4wMfoRXlfv0ub4XiG9zmOKNwv0S37Q/g1zkmfAJa3Ws+SVBpniHsI 1cr0oe5tbMeQ== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="180949929" X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="180949929" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 22:39:45 -0800 IronPort-SDR: 8gApPK6r3IA+kJTMvdvZ+UWtD9QRP402rgWmy3cWxHWyRoru6P2l8kHzS1Q5rAU1gaj17CJo6G QOcgD2Vi+NMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="391312384" Received: from dpdk_jiangcheng.sh.intel.com ([10.67.119.112]) by orsmga008.jf.intel.com with ESMTP; 01 Feb 2021 22:39:42 -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 06:28:30 +0000 Message-Id: <20210202062830.4490-1-Cheng1.jiang@intel.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] 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. Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path") Coverity issue: 366264 Signed-off-by: Cheng Jiang --- 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