Whamcloud - gitweb
LU-2745 lnet: fix failure handle of create reply
[fs/lustre-release.git] / lnet / lnet / lib-move.c
index ce7f926..30a70ae 100644 (file)
@@ -2213,16 +2213,16 @@ lnet_create_reply_msg (lnet_ni_t *ni, lnet_msg_t *getmsg)
        LASSERT(!getmsg->msg_target_is_router);
        LASSERT(!getmsg->msg_routing);
 
+       if (msg == NULL) {
+               CERROR("%s: Dropping REPLY from %s: can't allocate msg\n",
+                      libcfs_nid2str(ni->ni_nid), libcfs_id2str(peer_id));
+               goto drop;
+       }
+
        cpt = lnet_cpt_of_cookie(getmd->md_lh.lh_cookie);
        lnet_res_lock(cpt);
 
-        LASSERT (getmd->md_refcount > 0);
-
-        if (msg == NULL) {
-                CERROR ("%s: Dropping REPLY from %s: can't allocate msg\n",
-                        libcfs_nid2str(ni->ni_nid), libcfs_id2str(peer_id));
-                goto drop;
-        }
+       LASSERT(getmd->md_refcount > 0);
 
         if (getmd->md_threshold == 0) {
                 CERROR ("%s: Dropping REPLY from %s for inactive MD %p\n",