Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17924903ybl; Thu, 2 Jan 2020 14:56:11 -0800 (PST) X-Google-Smtp-Source: APXvYqx3/Gq838aOtsPa0MG0HJBvqZef5bx3zvOKytOqUoW8qU7mIMbWuOOxFySFO7wVY0h77DMo X-Received: by 2002:a05:6830:1d91:: with SMTP id y17mr89856253oti.276.1578005770872; Thu, 02 Jan 2020 14:56:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005770; cv=none; d=google.com; s=arc-20160816; b=OokWtcFd1ki364CCpW1Uh1pRx1J2aH61HLD7I4BfWTfNl8v/DOiHBCtI2/jvyBiHDG loUIf5DaX9jaOoetKAA1rYNkUkJbGzK2ds9tqCnLOmZ5i/JUt9hl5OcJcEWUbVbtELbJ r1q0a6nrCOiDhLeGT1rcdkY8M00LVm9DZcaE8Vz5xhrCNZ5NbFv//eQXYpwfVM9iLwxq /7duUUQaxCBQCL+2HKNd7CKJYR3wtc7oDzfWWbDR1jYZX7a9ckNs2f7zmmOpUHO0JGnl cKNrUgAOdTbOMETw5hGA7hKQEMn1dvBofO/UFdcQkKrU8u+ZkNTrGgBoMY+8PzT9Dsob Q0HQ== 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=+sLNmAersUi3JjNoHGNg24RTPplpSiodGHGbamTp0WI=; b=bm33ZwoeTQHiEH8pTQ0OwzxcxGZl0TbZgOe2Z7hAhM5FVMFMOafso4MPP4q3iszYos j/O3ueS/2Y1by8i5WgnetLfLfRZPGVknsBigrmEixUNrAFwCpOSUawgwTkyYI2TA9x3u eI2AhcuOXThgV6x+D8KncUjVd8Ip6qDdy1aPnfEwyYWPA8F7D2jGI5gkIgvza0wbnfZJ 6waizhmryyo1FrcnnWIaZjsnI+C9TIe8+gTowJJXodluIK9tXpR0IDwM/6NcUZXUB018 NJ5CKAjrKnxD8MJur+HTxx6BSXGVnmdMXq6IPmXxt5yOfxj6+dFIaeSO3wTBcX0cOf2p qYrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VI/btbdt"; 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 d6si11402263oic.274.2020.01.02.14.55.59; Thu, 02 Jan 2020 14:56:10 -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="VI/btbdt"; 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 S1729256AbgABWxy (ORCPT + 99 others); Thu, 2 Jan 2020 17:53:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:40278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728432AbgABWVU (ORCPT ); Thu, 2 Jan 2020 17:21:20 -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 9C27C222C3; Thu, 2 Jan 2020 22:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003680; bh=d18jTLWfApfwUh6KARUD1FZQRxSZd5VOJTbozrBOtrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VI/btbdtiEbY12kOBu0xixGh45DssxNPWmJ6hoNRrDKGJ/FHVmgfpUlWBrRc02CvV odfvr4yVVkgiAPSOrd0AnIBQBe+svvnoaMykrv/R0oM1TgAFRpy6K4XBgYC76hBqv/ +9Ajdvt5KH8+mR8Anlc0+oPG0l5Ck7SsrIuY8Qus= 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 4.19 069/114] ocfs2: fix passing zero to PTR_ERR warning Date: Thu, 2 Jan 2020 23:07:21 +0100 Message-Id: <20200102220036.033585825@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@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 917fadca8a7b..b73b78771915 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -335,8 +335,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