IB/mthca: Fix error return code in __mthca_init_one()
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 29 Sep 2018 03:55:16 +0000 (03:55 +0000)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 3 Oct 2018 22:02:10 +0000 (16:02 -0600)
Fix to return a negative error code from the mthca_cmd_init() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 80fd8238734c ("[PATCH] IB/mthca: Encapsulate command interface init")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mthca/mthca_main.c

index f99c7e0b234c5ed74e4cb86c592e4027179c7bcf..92c49bff22bc31d9cd7d023ee64d08a135108264 100644 (file)
@@ -986,7 +986,8 @@ static int __mthca_init_one(struct pci_dev *pdev, int hca_type)
                goto err_free_dev;
        }
 
-       if (mthca_cmd_init(mdev)) {
+       err = mthca_cmd_init(mdev);
+       if (err) {
                mthca_err(mdev, "Failed to init command interface, aborting.\n");
                goto err_free_dev;
        }