Skip to content

Commit c799fca

Browse files
jgunthorpedavem330
authored andcommitted
net/cxgb4: Check the return from t4_query_params properly
Positive return values are also failures that don't set val, although this probably can't happen. Fixes gcc 10 warning: drivers/net/ethernet/chelsio/cxgb4/t4_hw.c: In function ‘t4_phy_fw_ver’: drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:3747:14: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized] 3747 | *phy_fw_ver = val; Fixes: 01b6961 ("cxgb4: Add PHY firmware support for T420-BT cards") Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a7a0d62 commit c799fca

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/chelsio/cxgb4

1 file changed

+1
-1
lines changed

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3742,7 +3742,7 @@ int t4_phy_fw_ver(struct adapter *adap, int *phy_fw_ver)
37423742
FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_VERSION));
37433743
ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1,
37443744
&param, &val);
3745-
if (ret < 0)
3745+
if (ret)
37463746
return ret;
37473747
*phy_fw_ver = val;
37483748
return 0;

0 commit comments

Comments
 (0)