mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
btrfs: replace empty string with NULL when getting attribute length in 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>
This commit is contained in:
parent
ab3629ed86
commit
7e35eab958
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
size = btrfs_getxattr(inode, name, "", 0);
|
size = btrfs_getxattr(inode, name, NULL, 0);
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
value = kzalloc(size, GFP_KERNEL);
|
value = kzalloc(size, GFP_KERNEL);
|
||||||
if (!value)
|
if (!value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue