Merge branch 'cleanups' of git://repo.or.cz/linux-2.6/btrfs-unstable into inode_numbers
[sfrench/cifs-2.6.git] / fs / btrfs / acl.c
index 5d505aaa72fb8326eb451687590b336c2e04052a..f66fc99597331383890ac4847329faf6a494ddb0 100644 (file)
@@ -178,12 +178,13 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,
 
        if (value) {
                acl = posix_acl_from_xattr(value, size);
+               if (IS_ERR(acl))
+                       return PTR_ERR(acl);
+
                if (acl) {
                        ret = posix_acl_valid(acl);
                        if (ret)
                                goto out;
-               } else if (IS_ERR(acl)) {
-                       return PTR_ERR(acl);
                }
        }
 
@@ -287,7 +288,7 @@ int btrfs_acl_chmod(struct inode *inode)
                return 0;
 
        acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS);
-       if (IS_ERR(acl) || !acl)
+       if (IS_ERR_OR_NULL(acl))
                return PTR_ERR(acl);
 
        clone = posix_acl_clone(acl, GFP_KERNEL);