Whamcloud - gitweb
LU-6587 obdclass: use OBD_FREE_LARGE with OBD_ALLOC_LARGE
[fs/lustre-release.git] / lustre / llite / file.c
index 0d13b13..8e6afbd 100644 (file)
@@ -1571,13 +1571,12 @@ static int ll_lov_setea(struct inode *inode, struct file *file,
        if (lump == NULL)
                 RETURN(-ENOMEM);
 
-       if (copy_from_user(lump, (struct lov_user_md __user *)arg, lum_size)) {
-               OBD_FREE_LARGE(lump, lum_size);
-               RETURN(-EFAULT);
-       }
+       if (copy_from_user(lump, (struct lov_user_md __user *)arg, lum_size))
+               GOTO(out_lump, rc = -EFAULT);
 
        rc = ll_lov_setstripe_ea_info(inode, file, flags, lump, lum_size);
 
+out_lump:
        OBD_FREE_LARGE(lump, lum_size);
        RETURN(rc);
 }
@@ -3859,7 +3858,7 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
        }
        unlock_res_and_lock(lock);
 
-       if (lvbdata != NULL)
+       if (lvbdata)
                OBD_FREE_LARGE(lvbdata, lmmsize);
 
        EXIT;