Skip to content

Commit 65fac4f

Browse files
xiongzhongjiangdavem330
authored andcommitted
net: bnxt: Fix a uninitialized variable warning.
Fix the following compile warning: drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:49:5: warning: �nvm_param.dir_type� may be used uninitialized in this function [-Wmaybe-uninitialized] if (nvm_param.dir_type == BNXT_NVM_PORT_CFG) Signed-off-by: zhong jiang <zhongjiang@huawei.com> Acked-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6344244 commit 65fac4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
4646
}
4747
}
4848

49+
if (i == ARRAY_SIZE(nvm_params))
50+
return -EOPNOTSUPP;
51+
4952
if (nvm_param.dir_type == BNXT_NVM_PORT_CFG)
5053
idx = bp->pf.port_id;
5154
else if (nvm_param.dir_type == BNXT_NVM_FUNC_CFG)

0 commit comments

Comments
 (0)