]> err.no Git - linux-2.6/commitdiff
[PATCH] IB/mthca: only free doorbell records in mem-free mode
authorRoland Dreier <roland@topspin.com>
Sat, 16 Apr 2005 22:26:21 +0000 (15:26 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 16 Apr 2005 22:26:21 +0000 (15:26 -0700)
On error path, only free doorbell records if we're in mem-free mode.

Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/infiniband/hw/mthca/mthca_cq.c

index 5dead2df7eb068eaa63dd3f67a91e9ce8e21ef00..8b3ffd23e50527303ac4cbdad3db2c50c9a89702 100644 (file)
@@ -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);