Commit 281d1a92 authored by Wei Yongjun's avatar Wei Yongjun Committed by Roland Dreier

IB/mlx5: Fix error return code in init_one()

Fix to return a negative error code from the error handling case
instead of 0, as done elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 3b2f64d0
...@@ -1426,7 +1426,8 @@ static int init_one(struct pci_dev *pdev, ...@@ -1426,7 +1426,8 @@ static int init_one(struct pci_dev *pdev,
if (err) if (err)
goto err_eqs; goto err_eqs;
if (ib_register_device(&dev->ib_dev, NULL)) err = ib_register_device(&dev->ib_dev, NULL);
if (err)
goto err_rsrc; goto err_rsrc;
err = create_umr_res(dev); err = create_umr_res(dev);
...@@ -1434,8 +1435,9 @@ static int init_one(struct pci_dev *pdev, ...@@ -1434,8 +1435,9 @@ static int init_one(struct pci_dev *pdev,
goto err_dev; goto err_dev;
for (i = 0; i < ARRAY_SIZE(mlx5_class_attributes); i++) { for (i = 0; i < ARRAY_SIZE(mlx5_class_attributes); i++) {
if (device_create_file(&dev->ib_dev.dev, err = device_create_file(&dev->ib_dev.dev,
mlx5_class_attributes[i])) mlx5_class_attributes[i]);
if (err)
goto err_umrc; goto err_umrc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment