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

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


err, like this really:

commit 19219048ce32931392ca703f4cd9d54a8926215b
Author: Eli Cohen <eli at mellanox.co.il>
Date:   Sun May 6 09:27:29 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..0515052 100644
--- a/drivers/infiniband/hw/mlx4/doorbell.c
+++ b/drivers/infiniband/hw/mlx4/doorbell.c
@@ -131,8 +131,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