提交 797eeae9 编写于 作者: J Jiapeng Chong 提交者: Yang Yingliang

mlx4: Fix missing error code in mlx4_load_one()

stable inclusion
from linux-4.19.201
commit 6f243cef30e4439122da672f6b845c1a9349da8d

--------------------------------

[ Upstream commit 7e4960b3 ]

The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'err'.

Eliminate the follow smatch warning:

drivers/net/ethernet/mellanox/mlx4/main.c:3538 mlx4_load_one() warn:
missing error code 'err'.
Reported-by: NAbaci Robot <abaci@linux.alibaba.com>
Fixes: 7ae0e400 ("net/mlx4_core: Flexible (asymmetric) allocation of EQs and MSI-X vectors for PF/VFs")
Signed-off-by: NJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: NTariq Toukan <tariqt@nvidia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8e0c6644
...@@ -3515,6 +3515,7 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data, ...@@ -3515,6 +3515,7 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
if (!SRIOV_VALID_STATE(dev->flags)) { if (!SRIOV_VALID_STATE(dev->flags)) {
mlx4_err(dev, "Invalid SRIOV state\n"); mlx4_err(dev, "Invalid SRIOV state\n");
err = -EINVAL;
goto err_close; goto err_close;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册