Skip to contentSkip to conversation

IB/mlx5: fix null dereference

PATCH In review Saurabh Sengar 2 participants 2 messages Nov 22, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/mlx5: fix null dereference

removing null dereference

---
is there any better way to fix it ?
as if there is no 'x' there is no way we can access 'x->lock'

 drivers/infiniband/hw/mlx5/qp.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/infiniband/hw/mlx5/qp.c +0 -6
index 307bdbc..613a853 100644
@@ -1064,13 +1064,10 @@ static void mlx5_ib_lock_cqs(struct mlx5_ib_cq *send_cq, struct mlx5_ib_cq *recv
 			}
 		} else {
 			spin_lock_irq(&send_cq->lock);
-			__acquire(&recv_cq->lock);
 		}
 	} else if (recv_cq) {
 		spin_lock_irq(&recv_cq->lock);
-		__acquire(&send_cq->lock);
 	} else {
-		__acquire(&send_cq->lock);
 		__acquire(&recv_cq->lock);
 	}
 }
@@ -1091,15 +1088,12 @@ static void mlx5_ib_unlock_cqs(struct mlx5_ib_cq *send_cq, struct mlx5_ib_cq *re
 				spin_unlock_irq(&recv_cq->lock);
 			}
 		} else {
-			__release(&recv_cq->lock);
 			spin_unlock_irq(&send_cq->lock);
 		}
 	} else if (recv_cq) {
-		__release(&send_cq->lock);
 		spin_unlock_irq(&recv_cq->lock);
 	} else {
 		__release(&recv_cq->lock);
-		__release(&send_cq->lock);
 	}
 }
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · Saurabh Sengar

removing null dereference

How so? These are just sparse annotations, so I can't see how we'll actually derference them. That beeing said they certainly are incorrect..