Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be65f086f2a50c478b2f5ecf4c55a52a4e95059a
Commit:     be65f086f2a50c478b2f5ecf4c55a52a4e95059a
Parent:     8aa08602bdd617a9cdd147f19076a8c8a70e03ef
Author:     Sean Hefty <[EMAIL PROTECTED]>
AuthorDate: Mon May 7 11:49:12 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:56:32 2007 -0700

    RDMA/cma: Fix synchronization with device removal in cma_iw_handler
    
    The cma_iw_handler needs to validate the state of the rdma_cm_id before
    processing a new connection request to ensure that a device removal is
    not already being processed for the same rdma_cm_id.  Without the state
    check, the user can receive simultaneous callbacks for the same cm_id, or
    a callback after they've destroyed the cm_id.
    
    Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/core/cma.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index d026764..cfd57b4 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1183,9 +1183,10 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, struct 
iw_cm_event *iw_event)
        struct sockaddr_in *sin;
        int ret = 0;
 
-       memset(&event, 0, sizeof event);
-       atomic_inc(&id_priv->dev_remove);
+       if (cma_disable_remove(id_priv, CMA_CONNECT))
+               return 0;
 
+       memset(&event, 0, sizeof event);
        switch (iw_event->event) {
        case IW_CM_EVENT_CLOSE:
                event.event = RDMA_CM_EVENT_DISCONNECTED;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to