From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87C4EC433E0 for ; Wed, 8 Jul 2020 02:54:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59A2820708 for ; Wed, 8 Jul 2020 02:54:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728001AbgGHCyO (ORCPT ); Tue, 7 Jul 2020 22:54:14 -0400 Received: from mga17.intel.com ([192.55.52.151]:26914 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727090AbgGHCyO (ORCPT ); Tue, 7 Jul 2020 22:54:14 -0400 IronPort-SDR: XmDjGg8HIbBEtqh1XtGAMIi/RtSzgA4O43RPdLR9k3G+cVuQDmXD81B8MZ8f1LrMIKHyTtP9J/ tP2Ur16Zsu4w== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="127810476" X-IronPort-AV: E=Sophos;i="5.75,326,1589266800"; d="scan'208";a="127810476" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 19:54:13 -0700 IronPort-SDR: EBZvnd03NPS+TuhppMhOZNF6878Wnw1XPq3zJLTvztc+6oIjBNCD+CkeshtoVSXuD+7V7Q56z5 UgKhwF/EwbNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,326,1589266800"; d="scan'208";a="322825400" Received: from lkp-server01.sh.intel.com (HELO f2047cb89c8e) ([10.239.97.150]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jul 2020 19:54:12 -0700 Received: from kbuild by f2047cb89c8e with local (Exim 4.92) (envelope-from ) id 1jt0Dr-0000VB-R6; Wed, 08 Jul 2020 02:54:11 +0000 Date: Wed, 8 Jul 2020 10:53:13 +0800 From: kernel test robot To: Daniel Colascione Cc: kbuild-all@lists.01.org, linux-security-module@vger.kernel.org, James Morris Subject: [PATCH] fix err_cast.cocci warnings Message-ID: <20200708025313.GA9647@57f8f660a35b> References: <202007081008.YPssDcFv%lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202007081008.YPssDcFv%lkp@intel.com> X-Patchwork-Hint: ignore User-Agent: Mutt/1.10.1 (2018-07-13) Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: From: kernel test robot fs/anon_inodes.c:92:10-17: WARNING: ERR_CAST can be used with inode Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Generated by: scripts/coccinelle/api/err_cast.cocci Fixes: 2749d3f84a70 ("Add a new LSM-supporting anonymous inode interface") CC: Daniel Colascione Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git secure_uffd_v5.9 head: d08ac70b1e0dc71ac2315007bcc3efb283b2eae4 commit: 2749d3f84a708110ed0359579be0eddd2c4036da [1/3] Add a new LSM-supporting anonymous inode interface anon_inodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/anon_inodes.c +++ b/fs/anon_inodes.c @@ -89,7 +89,7 @@ struct file *_anon_inode_getfile(const c inode = anon_inode_make_secure_inode( name, context_inode); if (IS_ERR(inode)) - return ERR_PTR(PTR_ERR(inode)); + return ERR_CAST(inode); } else { inode = anon_inode_inode; if (IS_ERR(inode))