From patchwork Tue Jul 16 08:43:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Xiang X-Patchwork-Id: 11045567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7184C1395 for ; Tue, 16 Jul 2019 08:53:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6174A28581 for ; Tue, 16 Jul 2019 08:53:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54AF9285A5; Tue, 16 Jul 2019 08:53:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A54D528581 for ; Tue, 16 Jul 2019 08:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727906AbfGPIxg (ORCPT ); Tue, 16 Jul 2019 04:53:36 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:3246 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbfGPIxf (ORCPT ); Tue, 16 Jul 2019 04:53:35 -0400 X-Greylist: delayed 552 seconds by postgrey-1.27 at vger.kernel.org; Tue, 16 Jul 2019 04:53:34 EDT Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app11-12011 (RichMail) with SMTP id 2eeb5d2d8e4d7b6-6e9dd; Tue, 16 Jul 2019 16:43:58 +0800 (CST) X-RM-TRANSID: 2eeb5d2d8e4d7b6-6e9dd X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.105.0.243]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65d2d8e4cfc6-46186; Tue, 16 Jul 2019 16:43:58 +0800 (CST) X-RM-TRANSID: 2ee65d2d8e4cfc6-46186 From: Ding Xiang To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] NFS: fix 'passing zero to PTR_ERR()' warning Date: Tue, 16 Jul 2019 16:43:50 +0800 Message-Id: <1563266630-6471-1-git-send-email-dingxiang@cmss.chinamobile.com> X-Mailer: git-send-email 1.9.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix a static code checker warning: fs/nfs/nfs4idmap.c:331 nfs_idmap_get_key() warn: passing zero to 'PTR_ERR' Signed-off-by: Ding Xiang --- fs/nfs/nfs4idmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c index 1e72963..f71bb7f 100644 --- a/fs/nfs/nfs4idmap.c +++ b/fs/nfs/nfs4idmap.c @@ -328,7 +328,7 @@ static ssize_t nfs_idmap_get_key(const char *name, size_t namelen, payload = user_key_payload_rcu(rkey); if (IS_ERR_OR_NULL(payload)) { - ret = PTR_ERR(payload); + ret = PTR_ERR_OR_ZERO(payload); goto out_up; }