From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emmanuel Roullit Subject: [PATCH 1/3] net/cxgbe: init data value before reading seeprom Date: Tue, 24 Jan 2017 21:48:57 +0100 Message-ID: <20170124204859.8998-1-emmanuel.roullit@gmail.com> Cc: dev@dpdk.org To: rahul.lakkireddy@chelsio.com Return-path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id A563C1023 for ; Tue, 24 Jan 2017 21:49:18 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id c85so37403718wmi.1 for ; Tue, 24 Jan 2017 12:49:18 -0800 (PST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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