From: Roland Dreier Date: Sat, 16 Apr 2005 22:26:21 +0000 (-0700) Subject: [PATCH] IB/mthca: only free doorbell records in mem-free mode X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b635fa215192a02e58e8e30d5d927435aa108192;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] IB/mthca: only free doorbell records in mem-free mode On error path, only free doorbell records if we're in mem-free mode. Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c index 5dead2df7eb0..8b3ffd23e505 100644 --- a/drivers/infiniband/hw/mthca/mthca_cq.c +++ b/drivers/infiniband/hw/mthca/mthca_cq.c @@ -817,10 +817,12 @@ err_out_free_mr: err_out_mailbox: kfree(mailbox); - mthca_free_db(dev, MTHCA_DB_TYPE_CQ_ARM, cq->arm_db_index); + if (dev->hca_type == ARBEL_NATIVE) + mthca_free_db(dev, MTHCA_DB_TYPE_CQ_ARM, cq->arm_db_index); err_out_ci: - mthca_free_db(dev, MTHCA_DB_TYPE_CQ_SET_CI, cq->set_ci_db_index); + if (dev->hca_type == ARBEL_NATIVE) + mthca_free_db(dev, MTHCA_DB_TYPE_CQ_SET_CI, cq->set_ci_db_index); err_out_icm: mthca_table_put(dev, dev->cq_table.table, cq->cqn);