Skip to content

Commit

Permalink
IB/mlx5: Fix error return code in init_one()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling case
instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Wei Yongjun authored and Roland Dreier committed Jul 31, 2013
1 parent 3b2f64d commit 281d1a9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/infiniband/hw/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,16 +1426,18 @@ static int init_one(struct pci_dev *pdev,
if (err)
goto err_eqs;

if (ib_register_device(&dev->ib_dev, NULL))
err = ib_register_device(&dev->ib_dev, NULL);
if (err)
goto err_rsrc;

err = create_umr_res(dev);
if (err)
goto err_dev;

for (i = 0; i < ARRAY_SIZE(mlx5_class_attributes); i++) {
if (device_create_file(&dev->ib_dev.dev,
mlx5_class_attributes[i]))
err = device_create_file(&dev->ib_dev.dev,
mlx5_class_attributes[i]);
if (err)
goto err_umrc;
}

Expand Down

0 comments on commit 281d1a9

Please sign in to comment.