[PATCH rdma v2] RDMA: Add rdma_connect_locked()

Jason Gunthorpe jgg at nvidia.com
Wed Oct 28 08:14:37 EDT 2020


On Wed, Oct 28, 2020 at 11:19:14AM +0200, Maor Gottlieb wrote:
> > +			struct rdma_conn_param *conn_param)
> >   {
> >   	struct rdma_id_private *id_priv =
> >   		container_of(id, struct rdma_id_private, id);
> >   	int ret;
> > -	mutex_lock(&id_priv->handler_mutex);
> 
> You need to delete the mutex_unlock in success path too.

Gaaaaah. Just goes to prove I shouldn't write patches with a child on
my lap :\

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index f58d19881524dc..a77750b8954db0 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -4072,7 +4072,6 @@ int rdma_connect_locked(struct rdma_cm_id *id,
 		ret = -ENOSYS;
 	if (ret)
 		goto err_state;
-	mutex_unlock(&id_priv->handler_mutex);
 	return 0;
 err_state:
 	cma_comp_exch(id_priv, RDMA_CM_CONNECT, RDMA_CM_ROUTE_RESOLVED);

Thanks,
Jason



More information about the Linux-nvme mailing list