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); -- 2.25.1