Re: [PATCH 1/2] fs/ntfs3: Fix pass zero to ERR_PTR() in ntfs_get_acl_ex

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

 



On Thu, Aug 26, 2021 at 11:35:48AM +0300, Kari Argillander wrote:
> Fix smatch warning:
> 	fs/ntfs3/xattr.c:529 ntfs_get_acl_ex()
> 	warn: passing zero to 'ERR_PTR'
> 
> Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations")
> Signed-off-by: Kari Argillander <kari.argillander@xxxxxxxxx>
> ---
>  fs/ntfs3/xattr.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
> index 98871c895e77..944557d3a769 100644
> --- a/fs/ntfs3/xattr.c
> +++ b/fs/ntfs3/xattr.c
> @@ -525,8 +525,10 @@ static struct posix_acl *ntfs_get_acl_ex(struct user_namespace *mnt_userns,
>  		acl = posix_acl_from_xattr(mnt_userns, buf, err);
>  		if (!IS_ERR(acl))
>  			set_cached_acl(inode, type, acl);
> +	} else if (!err || err == -ENODATA) {
> +		acl = NULL;
>  	} else {
> -		acl = err == -ENODATA ? NULL : ERR_PTR(err);
> +		acl = ERR_PTR(err);
>  	}
>  
>  	__putname(buf);

I just notice that this is same as Dan already has sended:
https://lore.kernel.org/ntfs3/20210824114858.GH31143@kili/

You can choose if you prefer this or that. Sorry for double patch.





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux