From patchwork Thu Sep 29 17:39:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John W. Linville" X-Patchwork-Id: 16252 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4B88768F2; Thu, 29 Sep 2016 19:45:28 +0200 (CEST) Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 52C9E5687; Thu, 29 Sep 2016 19:45:16 +0200 (CEST) Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1bpfOV-0001qu-5k; Thu, 29 Sep 2016 13:45:15 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.14.6) with ESMTP id u8THduwN010202; Thu, 29 Sep 2016 13:39:56 -0400 Received: (from linville@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id u8THdtGU010201; Thu, 29 Sep 2016 13:39:55 -0400 X-Authentication-Warning: localhost.localdomain: linville set sender to linville@tuxdriver.com using -f From: "John W. Linville" To: dev@dpdk.org Cc: dpdk stable Date: Thu, 29 Sep 2016 13:39:36 -0400 Message-Id: <1475170776-10130-5-git-send-email-linville@tuxdriver.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475170776-10130-1-git-send-email-linville@tuxdriver.com> References: <1475090404-20707-1-git-send-email-linville@tuxdriver.com> <1475170776-10130-1-git-send-email-linville@tuxdriver.com> Subject: [dpdk-dev] [PATCH v2 4/4] net/bnxt: add ULL suffix to constant 1 for bit shift in bnxt_mac_addr_remove_op X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some(?) compilers will treat the unmarked constant 1 as a 32-bit integer, but the shift operation is in a loop that could run up to 63 times -- undefined behavior! Coverity issue: 127546 Fixes: 778b759ba10e ("net/bnxt: add MAC address") Signed-off-by: John W. Linville --- v2: fix-up changelog entries based-on comments from Ferruh Yigit drivers/net/bnxt/bnxt_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index f4eedfd812bb..d7447b15983b 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -463,7 +463,7 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev, * remove the corresponding MAC addr filter */ for (i = 0; i < MAX_FF_POOLS; i++) { - if (!(pool_mask & (1 << i))) + if (!(pool_mask & (1ULL << i))) continue; STAILQ_FOREACH(vnic, &bp->ff_pool[i], next) {