diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-07-30 01:54:26 +0200 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-07-31 23:12:07 +0200 |
commit | 281d1a9211986cfdccbefcd6128049a0a0d473b2 (patch) | |
tree | 7e8f8920e48b403d6cf0e904e5ec07c4cca3f6a2 /drivers/infiniband/hw/mlx5 | |
parent | Linux 3.11-rc2 (diff) | |
download | linux-281d1a9211986cfdccbefcd6128049a0a0d473b2.tar.xz linux-281d1a9211986cfdccbefcd6128049a0a0d473b2.zip |
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 8000fff4d444..b1cbf338bcf6 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -1426,7 +1426,8 @@ 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); @@ -1434,8 +1435,9 @@ static int init_one(struct pci_dev *pdev, 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; } |