From: Michael S. Tsirkin Date: Sat, 16 Apr 2005 22:26:19 +0000 (-0700) Subject: [PATCH] IB/mthca: fix MR allocation error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=55645e9b0ae202f9bd58e68eb141d7594163935f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] IB/mthca: fix MR allocation error path Fix error handling in MR allocation for mem-free mode: mthca_free must get an MR index, not a key. Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c index 5eb6e07f35bb..66656379ea7b 100644 --- a/drivers/infiniband/hw/mthca/mthca_mr.c +++ b/drivers/infiniband/hw/mthca/mthca_mr.c @@ -231,7 +231,7 @@ err_out_table: mthca_table_put(dev, dev->mr_table.mpt_table, key); err_out_mpt_free: - mthca_free(&dev->mr_table.mpt_alloc, mr->ibmr.lkey); + mthca_free(&dev->mr_table.mpt_alloc, key); kfree(mailbox); return err; } @@ -368,7 +368,7 @@ err_out_table: mthca_table_put(dev, dev->mr_table.mpt_table, key); err_out_mpt_free: - mthca_free(&dev->mr_table.mpt_alloc, mr->ibmr.lkey); + mthca_free(&dev->mr_table.mpt_alloc, key); return err; }