RE: [Intel-wired-lan] [PATCH] ice: initialize local variable 'tlv'

From: G, GurucharanX
Date: Fri Feb 18 2022 - 12:06:31 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> trix@xxxxxxxxxx
> Sent: Monday, February 14, 2022 9:11 PM
> To: Brandeburg, Jesse <jesse.brandeburg@xxxxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; davem@xxxxxxxxxxxxx; kuba@xxxxxxxxxx;
> nathan@xxxxxxxxxx; ndesaulniers@xxxxxxxxxx; Greenwalt, Paul
> <paul.greenwalt@xxxxxxxxx>; Swanson, Evan <evan.swanson@xxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; llvm@xxxxxxxxxxxxxxx; intel-wired-
> lan@xxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Tom Rix
> <trix@xxxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH] ice: initialize local variable 'tlv'
>
> From: Tom Rix <trix@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> ---
> drivers/net/ethernet/intel/ice/ice_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Tested-by: Gurucharan G <gurucharanx.g@xxxxxxxxx> (A Contingent worker at Intel)