Whamcloud - gitweb
LU-1187 lmv: allocate lmv tgts array by index
[fs/lustre-release.git] / lustre / liblustre / super.c
index 5110443..2d52736 100644 (file)
@@ -1345,12 +1345,12 @@ static int llu_file_flock(struct inode *ino,
                 if (lmv->desc.ld_tgt_count < 1)
                         RETURN(rc = -ENODEV);
 
-                if (lmv->tgts[0].ltd_exp != NULL)
-                       rc = ldlm_cli_enqueue(lmv->tgts[0].ltd_exp, NULL,
+               if (lmv->tgts[0] && lmv->tgts[0]->ltd_exp != NULL)
+                       rc = ldlm_cli_enqueue(lmv->tgts[0]->ltd_exp, NULL,
                                              &einfo, &res_id, &flock, &flags,
                                              NULL, 0, LVB_T_NONE, &lockh, 0);
-                else
-                        rc = -ENODEV;
+               else
+                       rc = -ENODEV;
         }
         RETURN(rc);
 }