DPDK patches and discussions
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [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	[thread overview]
Message-ID: <1475090404-20707-5-git-send-email-linville@tuxdriver.com> (raw)
In-Reply-To: <1475090404-20707-1-git-send-email-linville@tuxdriver.com>

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 <linville@tuxdriver.com>
---
 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

  parent reply	other threads:[~2016-09-28 19:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28 19:20 [dpdk-dev] [PATCH 0/4] random fixes for bugs identified by Coverity John W. Linville
2016-09-28 19:20 ` [dpdk-dev] [PATCH 1/4] ena_config_host_info: improve safety of string handling John W. Linville
2016-09-28 19:20 ` [dpdk-dev] [PATCH 2/4] bnxt_alloc_vnic_attributes: ensure entry_length is unsigned John W. Linville
2016-09-28 19:20 ` [dpdk-dev] [PATCH 3/4] i40e_vsi_release: do not use vsi until after NULL check John W. Linville
2016-09-29  8:15   ` Ferruh Yigit
2016-09-28 19:20 ` John W. Linville [this message]
2016-09-29 17:39 ` [dpdk-dev] [PATCH v2 0/4] random fixes for bugs identified by Coverity John W. Linville
2016-09-29 17:39   ` [dpdk-dev] [PATCH v2 1/4] net/ena: improve safety of string handling in ena_config_host_info John W. Linville
2016-10-12 16:24     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2016-09-29 17:39   ` [dpdk-dev] [PATCH v2 2/4] net/bnxt: ensure entry_length is unsigned in bnxt_alloc_vnic_attributes John W. Linville
2016-09-29 19:06     ` Ajit Khaparde
2016-09-29 17:39   ` [dpdk-dev] [PATCH v2 3/4] net/i40e: do not use vsi until after NULL check in i40e_vsi_release John W. Linville
2016-09-29 17:39   ` [dpdk-dev] [PATCH v2 4/4] net/bnxt: add ULL suffix to constant 1 for bit shift in bnxt_mac_addr_remove_op John W. Linville
2016-10-10 18:41     ` Ajit Khaparde
2016-10-13  9:31   ` [dpdk-dev] [PATCH v2 0/4] random fixes for bugs identified by Coverity Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1475090404-20707-5-git-send-email-linville@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).