From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John W. Linville" Subject: [PATCH 4/4] bnxt_mac_addr_remove_op: add ULL suffix to constant 1 in bit shift Date: Wed, 28 Sep 2016 15:20:04 -0400 Message-ID: <1475090404-20707-5-git-send-email-linville@tuxdriver.com> References: <1475090404-20707-1-git-send-email-linville@tuxdriver.com> To: dev@dpdk.org Return-path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 3D0365687 for ; Wed, 28 Sep 2016 21:30:15 +0200 (CEST) Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1bpKYY-0000Pv-It for dev@dpdk.org; Wed, 28 Sep 2016 15:30:14 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.14.6) with ESMTP id u8SJKA3k020775 for ; Wed, 28 Sep 2016 15:20:10 -0400 Received: (from linville@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id u8SJKASR020774 for dev@dpdk.org; Wed, 28 Sep 2016 15:20:10 -0400 In-Reply-To: <1475090404-20707-1-git-send-email-linville@tuxdriver.com> 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: 127546 Signed-off-by: John W. Linville --- 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) { -- 2.7.4