[ofa-general] [PATCH] IB/mlx4 mlx4_ib: free doorbel fix

Roland Dreier rdreier at cisco.com
Sun May 6 09:30:09 PDT 2007


err, one more try:

commit 49b070c5a9473fabb379c82761ecf8c573a9b548
Author: Eli Cohen <eli at mellanox.co.il>
Date:   Sun May 6 09:29:28 2007 -0700

    IB/mlx4: Fix free of doorbell record buddies
    
    When freeing an entry from order 1, the index field ends up shifted
    twice and the resulting index is wrong causing corruption of the
    data structure.
    
    Signed-off-by: Eli Cohen <eli at mellanox.co.il>
    Signed-off-by: Roland Dreier <rolandd at cisco.com>

diff --git a/drivers/infiniband/hw/mlx4/doorbell.c b/drivers/infiniband/hw/mlx4/doorbell.c
index 4b564d5..acb4ce2 100644
--- a/drivers/infiniband/hw/mlx4/doorbell.c
+++ b/drivers/infiniband/hw/mlx4/doorbell.c
@@ -132,7 +132,7 @@ void mlx4_ib_db_free(struct mlx4_ib_dev *dev, struct mlx4_ib_db *db)
 	spin_lock(&dev->pgdir_lock);
 
 	o = db->order;
-	i = db->index >> db->order;
+	i = db->index;
 
 	if (db->order == 0 && test_bit(i ^ 1, db->u.pgdir->order0)) {
 		clear_bit(i ^ 1, db->u.pgdir->order0);



More information about the general mailing list