Skip to content

Commit

Permalink
Btrfs: handle ERR_PTR from posix_acl_from_xattr()
Browse files Browse the repository at this point in the history
posix_acl_from_xattr() returns both ERR_PTRs and null, but it's OK to
pass null values to set_cached_acl()

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Dan Carpenter authored and Chris Mason committed Jun 11, 2010
1 parent 15e7000 commit 834e747
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 834e747

Please sign in to comment.