]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
mcm: segfault with counters, no CM object when not found and duplicate case
authorArlin Davis <arlin.r.davis@intel.com>
Tue, 21 May 2013 21:11:07 +0000 (14:11 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Wed, 22 May 2013 20:24:28 +0000 (13:24 -0700)
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
dapl/openib_mcm/cm.c

index d5af2a3b61d6b3dd5a01fbb40542359b96daddd9..022d132ad541f128732c3b12e45700ed6b34d225 100644 (file)
@@ -480,7 +480,6 @@ retry_listenq:
                                break; 
                        } else {
                                /* duplicate; bail and throw away */
-                               dapl_os_unlock(lock);
                                dapl_log(DAPL_DBG_TYPE_CM_WARN,
                                         " DUPLICATE: cm %p op %s (%s) st %s"
                                         " [lid, port, cqp, iqp]:"
@@ -498,14 +497,15 @@ retry_listenq:
                                         ntohs(cm->msg.saddr.lid), ntohs(cm->msg.sport),
                                         ntohl(cm->msg.sqpn), ntohl(cm->msg.saddr.qpn));
 
-                                       DAPL_CNTR(((DAPL_IA *)dapl_llist_peek_head(&cm->hca->ia_list_head)), DCNT_IA_CM_ERR_REQ_DUP);
+                               DAPL_CNTR(((DAPL_IA *)dapl_llist_peek_head(&cm->hca->ia_list_head)),
+                                           DCNT_IA_CM_ERR_REQ_DUP);
 
-                                       return NULL;
+                               dapl_os_unlock(lock);
+                               return NULL;
                        }
                }
        }
        dapl_os_unlock(lock);
-
        /* no duplicate request on connq, check listenq for new request */
        if (ntohs(msg->op) == MCM_REQ && !listenq && !found) {
                listenq = 1;
@@ -541,7 +541,7 @@ retry_listenq:
                         ntohl(msg->d_id));
 
                if (ntohs(msg->op) == MCM_DREP) {
-                       DAPL_CNTR(((DAPL_IA *)dapl_llist_peek_head(&cm->hca->ia_list_head)), DCNT_IA_CM_ERR_DREP_DUP);
+                       DAPL_CNTR(((DAPL_IA *)dapl_llist_peek_head(&tp->hca->ia_list_head)), DCNT_IA_CM_ERR_DREP_DUP);
                }
        }