Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1274860

[PATCH] IB/mlx5: fix null dereference

From Saurabh Sengar <saurabh.truth@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] IB/mlx5: fix null dereference
Date 2015-11-22 13:50 +0100
Message-ID <qxCfD-3Oi-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] IB/mlx5: fix null dereference Saurabh Sengar <saurabh.truth@gmail.com> - 2015-11-22 13:50 +0100
  Re: [PATCH] IB/mlx5: fix null dereference Christoph Hellwig <hch@infradead.org> - 2015-11-22 18:50 +0100

csiph-web