From: Emmanuel Roullit Date: Tue, 24 Jan 2017 20:48:57 +0000 (+0100) Subject: net/cxgbe/base: initialize variable before reading EEPROM X-Git-Tag: spdx-start~4603 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=dd995b23dfc22a28edc565ce6163a5c98068d302;p=dpdk.git net/cxgbe/base: initialize variable before reading EEPROM 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: fe0bd9ee5da3 ("net/cxgbe: support EEPROM access") Cc: stable@dpdk.org Signed-off-by: Emmanuel Roullit --- diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c index 7e79adf6d3..c089b068d2 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!