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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 64B7FC32751 for ; Sat, 10 Aug 2019 06:59:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A582217D7 for ; Sat, 10 Aug 2019 06:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725827AbfHJG7R (ORCPT ); Sat, 10 Aug 2019 02:59:17 -0400 Received: from mga17.intel.com ([192.55.52.151]:29595 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbfHJG7R (ORCPT ); Sat, 10 Aug 2019 02:59:17 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Aug 2019 23:59:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,368,1559545200"; d="scan'208";a="374707331" Received: from lkp-server01.sh.intel.com (HELO lkp-server01) ([10.239.97.150]) by fmsmga005.fm.intel.com with ESMTP; 09 Aug 2019 23:59:15 -0700 Received: from kbuild by lkp-server01 with local (Exim 4.89) (envelope-from ) id 1hwLLP-0009gp-Kr; Sat, 10 Aug 2019 14:59:15 +0800 Date: Sat, 10 Aug 2019 14:58:46 +0800 From: kbuild test robot To: Matthew Garrett Cc: kbuild-all@01.org, linux-security-module@vger.kernel.org, James Morris , Kees Cook Subject: [PATCH] security: fix ptr_ret.cocci warnings Message-ID: <20190810065846.6giywcprz47xbwij@48261080c7f1> References: <201908101444.zkWryFiG%lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908101444.zkWryFiG%lkp@intel.com> X-Patchwork-Hint: ignore User-Agent: NeoMutt/20170113 (1.7.2) Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: From: kbuild test robot security/lockdown/lockdown.c:157:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Fixes: 80d14015a8e3 ("security: Add a static lockdown policy LSM") CC: Matthew Garrett Signed-off-by: kbuild test robot --- tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/jmorris/linux-security.git next-lockdown head: 05ef41e93e1a40d6b2d9846284824ec6f67fe422 commit: 80d14015a8e3109f9b5e3e39b0bc78e1c3a1f315 [3/29] security: Add a static lockdown policy LSM lockdown.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/security/lockdown/lockdown.c +++ b/security/lockdown/lockdown.c @@ -154,10 +154,7 @@ static int __init lockdown_secfs_init(vo dentry = securityfs_create_file("lockdown", 0600, NULL, NULL, &lockdown_ops); - if (IS_ERR(dentry)) - return PTR_ERR(dentry); - - return 0; + return PTR_ERR_OR_ZERO(dentry); } core_initcall(lockdown_secfs_init);