]> Pileus Git - ~andy/linux/blobdiff - drivers/infiniband/core/cm.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[~andy/linux] / drivers / infiniband / core / cm.c
index ad63b79afac10ba071056d704119bad51877381a..64e0903091a8679f9f14490873f68c03baef8cca 100644 (file)
@@ -2409,10 +2409,12 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id,
                msg_response = CM_MSG_RESPONSE_REP;
                break;
        case IB_CM_ESTABLISHED:
-               cm_state = cm_id->state;
-               lap_state = IB_CM_MRA_LAP_SENT;
-               msg_response = CM_MSG_RESPONSE_OTHER;
-               break;
+               if (cm_id->lap_state == IB_CM_LAP_RCVD) {
+                       cm_state = cm_id->state;
+                       lap_state = IB_CM_MRA_LAP_SENT;
+                       msg_response = CM_MSG_RESPONSE_OTHER;
+                       break;
+               }
        default:
                ret = -EINVAL;
                goto error1;