From: Kari Argillander <kari.argillander@gmail.com>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
ntfs3@lists.linux.dev
Cc: Kari Argillander <kari.argillander@gmail.com>
Subject: [PATCH 1/2] fs/ntfs3: Fix pass zero to ERR_PTR() in ntfs_get_acl_ex
Date: Thu, 26 Aug 2021 11:35:48 +0300 [thread overview]
Message-ID: <20210826083549.1565173-2-kari.argillander@gmail.com> (raw)
In-Reply-To: <20210826083549.1565173-1-kari.argillander@gmail.com>
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@gmail.com>
---
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
next prev parent reply other threads:[~2021-08-26 8:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 8:35 [PATCH 0/2] fs/ntfs3: Fix minor things in ntfs_get_acl_ex() Kari Argillander
2021-08-26 8:35 ` Kari Argillander [this message]
2021-08-26 9:13 ` [PATCH 1/2] fs/ntfs3: Fix pass zero to ERR_PTR() in ntfs_get_acl_ex Kari Argillander
2021-08-26 8:35 ` [PATCH 2/2] fs/ntfs3: Fix missing type checking " Kari Argillander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210826083549.1565173-2-kari.argillander@gmail.com \
--to=kari.argillander@gmail.com \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=ntfs3@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox