diff mbox series

[-next] IB/mthca: Fix error return code in __mthca_init_one()

Message ID 1538193316-155845-1-git-send-email-weiyongjun1@huawei.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series [-next] IB/mthca: Fix error return code in __mthca_init_one() | expand

Commit Message

Wei Yongjun Sept. 29, 2018, 3:55 a.m. UTC
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>
---
 drivers/infiniband/hw/mthca/mthca_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jason Gunthorpe Oct. 3, 2018, 10:16 p.m. UTC | #1
On Sat, Sep 29, 2018 at 03:55:16AM +0000, Wei Yongjun wrote:
> 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>
> ---
>  drivers/infiniband/hw/mthca/mthca_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to for-next

Thanks,
Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index f99c7e0..92c49bf 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -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;
 	}