[patch] btrfs: add check for ERR_PTR()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



posix_acl_from_xattr() can sometimes return an ERR_PTR().

Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>

diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 6ef7b26..c6d84ce 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -60,7 +60,8 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
 		size = __btrfs_getxattr(inode, name, value, size);
 		if (size > 0) {
 			acl = posix_acl_from_xattr(value, size);
-			set_cached_acl(inode, type, acl);
+			if (!IS_ERR(acl))
+				set_cached_acl(inode, type, acl);
 		}
 		kfree(value);
 	} else if (size == -ENOENT || size == -ENODATA || size == 0) {
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux