From: Emmanuel Roullit <emmanuel.roullit@gmail.com>
To: rahul.lakkireddy@chelsio.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/3] net/cxgbe: init data value before reading seeprom
Date: Tue, 24 Jan 2017 21:48:57 +0100 [thread overview]
Message-ID: <20170124204859.8998-1-emmanuel.roullit@gmail.com> (raw)
data value could have been garbage if VPD access timed out for VPD read
request could not been issued.
Found with clang static analysis:
drivers/net/cxgbe/base/t4_hw.c:1577:22:
warning: The left operand of '&' is a garbage value
} while ((stats_reg & 0x1) && --max_poll);
~~~~~~~~~ ^
Fixes: 17ba077c5c54 ("net/cxgbe: support register dump")
Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
---
drivers/net/cxgbe/base/t4_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 7e79adf6d..c089b068d 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -1532,7 +1532,7 @@ int t4_seeprom_write(struct adapter *adapter, u32 addr, u32 data)
{
unsigned int base = adapter->params.pci.vpd_cap_addr;
int ret;
- u32 stats_reg;
+ u32 stats_reg = 0;
int max_poll;
/* VPD Accesses must alway be 4-byte aligned!
--
2.11.0
next reply other threads:[~2017-01-24 20:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 20:48 Emmanuel Roullit [this message]
2017-01-24 20:48 ` [dpdk-dev] [PATCH 2/3] net/cxgbe: remove unused variable usage Emmanuel Roullit
2017-01-25 12:13 ` Ferruh Yigit
2017-01-26 4:41 ` Rahul Lakkireddy
2017-01-26 11:05 ` Ferruh Yigit
2017-02-14 6:10 ` Yuanhan Liu
2017-01-24 20:48 ` [dpdk-dev] [PATCH 3/3] net/cxgbe: remove unused variable Emmanuel Roullit
2017-01-25 12:15 ` Ferruh Yigit
2017-01-25 12:12 ` [dpdk-dev] [PATCH 1/3] net/cxgbe: init data value before reading seeprom Ferruh Yigit
2017-01-26 11:06 ` Ferruh Yigit
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=20170124204859.8998-1-emmanuel.roullit@gmail.com \
--to=emmanuel.roullit@gmail.com \
--cc=dev@dpdk.org \
--cc=rahul.lakkireddy@chelsio.com \
/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).