aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2009-10-07 18:38:12 -0400
committerRoland Dreier <rolandd@cisco.com>2009-10-07 18:38:12 -0400
commit54e05f15ccb510c0fb3b03dfe9186811021fd5ad (patch)
tree0a3b395301d4611ca1338265d5eb68685f4d9f44 /drivers/infiniband
parentaa07a99412f56ad56faecbaa683f3bc0ae99abc2 (diff)
RDMA/iwcm: Don't call provider reject func with irqs disabled
In commit cb58160e ("RDMA/iwcm: Reject the connection when the cm_id is destroyed") a call to the provider's reject handler was added to destroy_cm_id() to fix a provider endpoint leak. This call needs to be done with interrupts enabled. So unlock and relock around this call. This is safe because: 1) the provider will do nothing with this endpoint until the iwcm either accepts or rejects. 2) the lock is only released after the iwcm state is changed, so an errant iwcm app that is destroying -and- rejecting the connection concurrently will get a failure on one of the calls. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/iwcm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index 55d093a36ae4..625fec5a741c 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -362,7 +362,9 @@ static void destroy_cm_id(struct iw_cm_id *cm_id)
362 * In either case, must tell the provider to reject. 362 * In either case, must tell the provider to reject.
363 */ 363 */
364 cm_id_priv->state = IW_CM_STATE_DESTROYING; 364 cm_id_priv->state = IW_CM_STATE_DESTROYING;
365 spin_unlock_irqrestore(&cm_id_priv->lock, flags);
365 cm_id->device->iwcm->reject(cm_id, NULL, 0); 366 cm_id->device->iwcm->reject(cm_id, NULL, 0);
367 spin_lock_irqsave(&cm_id_priv->lock, flags);
366 break; 368 break;
367 case IW_CM_STATE_CONN_SENT: 369 case IW_CM_STATE_CONN_SENT:
368 case IW_CM_STATE_DESTROYING: 370 case IW_CM_STATE_DESTROYING: