Linux-mm Archive on
 help / color / Atom feed
* [patch 002/158] ocfs2: fix passing zero to 'PTR_ERR' warning
@ 2019-12-01  1:49 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2019-12-01  1:49 UTC (permalink / raw)
  To: akpm, dingxiang, gechangwei, ghe, jlbec, joseph.qi,,
	linux-mm, mark, mm-commits, piaojun, torvalds

From: Ding Xiang <>
Subject: ocfs2: fix passing zero to 'PTR_ERR' warning

Fix a static code checker warning:
	ocfs2_acl_chmod() warn: passing zero to 'PTR_ERR'

Fixes: 5ee0fbd50fd ("ocfs2: revert using ocfs2_acl_chmod to avoid inode cluster lock hang")
Signed-off-by: Ding Xiang <>
Reviewed-by: Joseph Qi <>
Cc: Mark Fasheh <>
Cc: Joel Becker <>
Cc: Junxiao Bi <>
Cc: Changwei Ge <>
Cc: Gang He <>
Cc: Jun Piao <>
Signed-off-by: Andrew Morton <>

 fs/ocfs2/acl.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/ocfs2/acl.c~ocfs2-fix-passing-zero-to-ptr_err-warning
+++ a/fs/ocfs2/acl.c
@@ -327,8 +327,8 @@ int ocfs2_acl_chmod(struct inode *inode,
 	acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, bh);
-	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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01  1:49 [patch 002/158] ocfs2: fix passing zero to 'PTR_ERR' warning akpm

Linux-mm Archive on

Archives are clonable:
	git clone --mirror linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ \
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone