Message ID | 20220214154043.2891024-1-trix@redhat.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ice: initialize local variable 'tlv' | expand |
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of > trix@redhat.com > Sent: Monday, February 14, 2022 9:11 PM > To: Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L > <anthony.l.nguyen@intel.com>; davem@davemloft.net; kuba@kernel.org; > nathan@kernel.org; ndesaulniers@google.com; Greenwalt, Paul > <paul.greenwalt@intel.com>; Swanson, Evan <evan.swanson@intel.com> > Cc: netdev@vger.kernel.org; llvm@lists.linux.dev; intel-wired- > lan@lists.osuosl.org; linux-kernel@vger.kernel.org; Tom Rix > <trix@redhat.com> > Subject: [Intel-wired-lan] [PATCH] ice: initialize local variable 'tlv' > > From: Tom Rix <trix@redhat.com> > > Clang static analysis reports this issues > ice_common.c:5008:21: warning: The left expression of the compound > assignment is an uninitialized value. The computed value will > also be garbage > ldo->phy_type_low |= ((u64)buf << (i * 16)); > ~~~~~~~~~~~~~~~~~ ^ > > When called from ice_cfg_phy_fec() ldo is the unintialized local > variable tlv. So initialize. > > Fixes: ea78ce4dab05 ("ice: add link lenient and default override support") > Signed-off-by: Tom Rix <trix@redhat.com> > --- > drivers/net/ethernet/intel/ice/ice_common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index c57e5fc41cf8..0e4434e3c290 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -3379,7 +3379,7 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, if (fec == ICE_FEC_AUTO && ice_fw_supports_link_override(hw) && !ice_fw_supports_report_dflt_cfg(hw)) { - struct ice_link_default_override_tlv tlv; + struct ice_link_default_override_tlv tlv = { 0 }; status = ice_get_link_default_override(&tlv, pi); if (status)