Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11788723pjo; Thu, 2 Jan 2020 14:18:02 -0800 (PST) X-Google-Smtp-Source: APXvYqz8gJPyuz6IQn/izOsjNln9/vMIcVR2ec3QeHMPjtP+WPSB7p61VGRSUf/LgqIsYLKr/M/y X-Received: by 2002:aca:2b0a:: with SMTP id i10mr3207278oik.137.1578003482404; Thu, 02 Jan 2020 14:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003482; cv=none; d=google.com; s=arc-20160816; b=mXPGMH/F232FTgTLUBDI/7ISCozuY1H3emyu8UzWRK7urzCfvqZE/s3SWu5FS7qMTx ngp27VJOyMPfD89M0HbbtyohgXF/H6g/CzrWfBXPiDfWAe+m5WhuqYzrfvQ1x51HWFue 9X/IucYYfe3oqOAefXpb6NeekZxkSLpnhYPnFNbGtJv2ESV9V1pxgCTA3N29hr3ps09h 5w5i6oRdXPXBjLxyYlYk15sBbXgU96OXdY3EUs2AaSMgV5wXWVSCL4HL+mRvUNu1o4NB Hb5A3PcKSni/dDU4ixoO+ybLiH+UPAg32wd50f8oQHtA6Jez3eQIAoetMiiHjJevwMrL IdmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5OjeKS8UqemA6X/pIIKEG0ymwBoSffT0nc7Nk4ITwlM=; b=K/ZQLsMu++W0uklrWCkPAdxAcGRSCVlvb2pZ9t7oTiEXD99ddvOxeg8dbqd2s8syKL ia/c+rQcRYaBoP1cYbmBdQ0xbL3V357cDcj27YwS5yvwYX8p2qYUkxL4bKu4L8ntux9N QAahhvmuAVbn2BvlEfWs+3QA5Q9+skun5+WKgkK8wuBW3ErZ38QYAhxFzbpGMOn6H+Ea 7/B0G0nX98h1rR10SxBll6co/e6UpzHnERrYlu4MvAMU7LEKUpYUAKQ5dlu3wgxgbva9 Co252yFWZfuaFqTKN7F6K4Oh/5ryweChglBQsw+KGYUdloNkP8mGACWUg26DasHgJWZl S5UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V616QZ3z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si27849716otk.251.2020.01.02.14.17.50; Thu, 02 Jan 2020 14:18:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V616QZ3z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728135AbgABWPt (ORCPT + 99 others); Thu, 2 Jan 2020 17:15:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:57124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728123AbgABWPr (ORCPT ); Thu, 2 Jan 2020 17:15:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7F8EB2464B; Thu, 2 Jan 2020 22:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003347; bh=YW/kPlNUfm5ZT6K+q3qC8W58EQzYgyv6Hq4L+QNcLpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V616QZ3zZomI/WErRm9czQXh5NixJDmR/4/XWKx70IgXH4qHZl+1pSosdChob7WEH 2qzTDZuJ4qYQiiJg0us+SsAugVsRiDtYGlMAEW6HnDm2W6fbIm+MYrR5xzgMyKnY/M xo4nfLtGerS+5HfzsOKA0pioq2SNEVSUY6RlzyHU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ding Xiang , Joseph Qi , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Gang He , Jun Piao , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.4 123/191] ocfs2: fix passing zero to PTR_ERR warning Date: Thu, 2 Jan 2020 23:06:45 +0100 Message-Id: <20200102215842.970966983@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ding Xiang [ 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 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 Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/ocfs2/acl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index 3e7da392aa6f..bb981ec76456 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -327,8 +327,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; -- 2.20.1