summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDing Xiang <dingxiang@cmss.chinamobile.com>2019-11-30 17:49:12 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-04 13:34:37 +0100
commit2ee2b8c6968cb38cc92dbe112cb7804364b9c64c (patch)
tree826f232e09a84f4c6364915a61d5f64c6463bc14 /fs
parentf480ec73a07e585c866ddd51ffbe7c7952021810 (diff)
downloadlinux-stable-2ee2b8c6968cb38cc92dbe112cb7804364b9c64c.tar.gz
linux-stable-2ee2b8c6968cb38cc92dbe112cb7804364b9c64c.tar.bz2
linux-stable-2ee2b8c6968cb38cc92dbe112cb7804364b9c64c.zip
ocfs2: fix passing zero to 'PTR_ERR' warning
[ Upstream commit 188c523e1c271d537f3c9f55b6b65bf4476de32f ] Fix a static code checker warning: fs/ocfs2/acl.c:331 ocfs2_acl_chmod() warn: passing zero to 'PTR_ERR' Link: http://lkml.kernel.org/r/1dee278b-6c96-eec2-ce76-fe6e07c6e20f@linux.alibaba.com Fixes: 5ee0fbd50fd ("ocfs2: revert using ocfs2_acl_chmod to avoid inode cluster lock hang") Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> Cc: Mark Fasheh <mark@fasheh.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Changwei Ge <gechangwei@live.cn> Cc: Gang He <ghe@suse.com> Cc: Jun Piao <piaojun@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/acl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
index 1e0d8da0d3cd..80b92120c812 100644
--- a/fs/ocfs2/acl.c
+++ b/fs/ocfs2/acl.c
@@ -338,8 +338,8 @@ int ocfs2_acl_chmod(struct inode *inode, struct buffer_head *bh)
down_read(&OCFS2_I(inode)->ip_xattr_sem);
acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, bh);
up_read(&OCFS2_I(inode)->ip_xattr_sem);
- if (IS_ERR(acl) || !acl)
- return PTR_ERR(acl);
+ if (IS_ERR_OR_NULL(acl))
+ return PTR_ERR_OR_ZERO(acl);
ret = __posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
if (ret)
return ret;