Whamcloud - gitweb
LU-17773 lov: avoid partly outside array bounds build error
[fs/lustre-release.git] / lustre / lov / lov_ea.c
index 44dad1d..2755eb0 100644 (file)
@@ -523,23 +523,8 @@ lsme_unpack_comp(struct lov_obd *lov, struct lov_mds_md *lmm,
        unsigned int magic;
 
        magic = le32_to_cpu(lmm->lmm_magic);
-       if (!lov_supported_comp_magic(magic)) {
-               struct lov_stripe_md_entry *lsme;
-               size_t lsme_sz = offsetof(typeof(*lsme), lsme_oinfo[0]);
-               struct lov_stripe_md_entry lsme_init = {
-                       .lsme_pattern = le32_to_cpu(lmm->lmm_pattern),
-                       .lsme_magic = magic,
-               };
-
-               /* allocate a lsme holder for invalid magic lmm */
-               OBD_ALLOC_LARGE(lsme, lsme_sz);
-               if (!lsme)
-                       return ERR_PTR(-ENOMEM);
-
-               memcpy(lsme, &lsme_init, lsme_sz);
-
-               return lsme;
-       }
+       if (!lov_supported_comp_magic(magic))
+               RETURN(ERR_PTR(-EINVAL));
 
        if (magic != LOV_MAGIC_FOREIGN &&
            le16_to_cpu(lmm->lmm_stripe_count) == 0 &&