Skip to content

Commit

Permalink
bnx2x: Fix missing error code in bnx2x_iov_init_one()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiapeng Chong authored and David S. Miller committed May 25, 2021
1 parent 9453d45 commit 65161c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,10 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
goto failed;

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

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

Expand Down

0 comments on commit 65161c3

Please sign in to comment.