Skip to content

Commit

Permalink
btrfs: replace empty string with NULL when getting attribute length i…
Browse files Browse the repository at this point in the history
…n btrfs_get_acl

In btrfs_get_acl() the first call of btr_getxattr() is for getting the
length of attribute, the value buffer is never used in this case. So
it's better to replace empty string with NULL.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Chengguang Xu authored and David Sterba committed Aug 6, 2018
1 parent ab3629e commit 7e35eab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
return ERR_PTR(-EINVAL);
}

size = btrfs_getxattr(inode, name, "", 0);
size = btrfs_getxattr(inode, name, NULL, 0);
if (size > 0) {
value = kzalloc(size, GFP_KERNEL);
if (!value)
Expand Down

0 comments on commit 7e35eab

Please sign in to comment.