Skip to content

Commit 65161c3

Browse files
wb-zjp846396davem330
authored andcommitted
bnx2x: Fix missing error code in bnx2x_iov_init_one()
Eliminate the follow smatch warning: drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1227 bnx2x_iov_init_one() warn: missing error code 'err'. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9453d45 commit 65161c3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,10 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
12231223
goto failed;
12241224

12251225
/* SR-IOV capability was enabled but there are no VFs*/
1226-
if (iov->total == 0)
1226+
if (iov->total == 0) {
1227+
err = -EINVAL;
12271228
goto failed;
1229+
}
12281230

12291231
iov->nr_virtfn = min_t(u16, iov->total, num_vfs_param);
12301232

0 commit comments

Comments
 (0)