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

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


Thanks, good catch... I fixed it this way:

commit e5b1dd9313497cc22ae171ab6cccb7eb044aba53
Author: Eli Cohen <eli at mellanox.co.il>
Date:   Sun May 6 09:20:13 2007 -0700

    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..e55c286 100644
--- a/drivers/infiniband/hw/mlx4/doorbell.c
+++ b/drivers/infiniband/hw/mlx4/doorbell.c
@@ -132,7 +132,6 @@ 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;
 
 	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