bnx2x: Fix missing error code in bnx2x_iov_init_one()

[ Upstream commit 65161c3555 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Jiapeng Chong 2021-05-25 19:00:12 +08:00 committed by Greg Kroah-Hartman
parent 93f5035182
commit e862f6000a

View file

@ -1242,8 +1242,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);