Skip to contentSkip to conversation

btrfs: handle ERR_PTR from posix_acl_from_xattr()

PATCH In review Dan Carpenter 1 participant 1 message May 29, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 10/11 btrfs: handle ERR_PTR from posix_acl_from_xattr()

posix_acl_from_xattr() returns both ERR_PTRs and null, but it's OK to pass null values to set_cached_acl()

fs/btrfs/acl.c +2 -0
index 8d432cd..e24a19a 100644
@@ -60,6 +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);
+			if (IS_ERR(acl))
+				return acl;
 			set_cached_acl(inode, type, acl);
 		}
 		kfree(value);