mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] IB/mlx5: fix null dereference
@ 2015-11-22 12:48 Saurabh Sengar
  2015-11-22 17:41 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Saurabh Sengar @ 2015-11-22 12:48 UTC (permalink / raw)
  To: eli, dledford, sean.hefty, hal.rosenstock, linux-rdma, linux-kernel
  Cc: Saurabh Sengar

removing null dereference

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
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(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 307bdbc..613a853 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -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);
 	}
 }
 
-- 
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-22 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-22 12:48 [PATCH] IB/mlx5: fix null dereference Saurabh Sengar
2015-11-22 17:41 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®