From patchwork Fri Feb 17 19:35:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9580597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 814C9600C5 for ; Fri, 17 Feb 2017 19:27:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66F7E28769 for ; Fri, 17 Feb 2017 19:27:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 586642876E; Fri, 17 Feb 2017 19:27:56 +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=-6.9 required=2.0 tests=BAYES_00,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 D20E328769 for ; Fri, 17 Feb 2017 19:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932545AbdBQT1y (ORCPT ); Fri, 17 Feb 2017 14:27:54 -0500 Received: from mga07.intel.com ([134.134.136.100]:30353 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755932AbdBQT1x (ORCPT ); Fri, 17 Feb 2017 14:27:53 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 17 Feb 2017 11:27:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,173,1484035200"; d="scan'208";a="1130634911" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga002.fm.intel.com with ESMTP; 17 Feb 2017 11:27:51 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1ceoEH-000F3I-Gk; Sat, 18 Feb 2017 03:30:05 +0800 Date: Sat, 18 Feb 2017 03:35:21 +0800 From: kbuild test robot To: "J. Bruce Fields" Cc: kbuild-all@01.org, Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, Andreas Gruenbacher , Weston Andros Adamson , "J. Bruce Fields" Subject: [PATCH] nfsd4: fix ifnullfree.cocci warnings Message-ID: <20170217193521.GA62045@lkp-sb04.lkp.intel.com> References: <201702180301.FBMzLirK%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1487349854-9732-4-git-send-email-bfields@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false 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 fs/nfs/nfs4proc.c:5135:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci CC: J. Bruce Fields Signed-off-by: Fengguang Wu --- nfs4proc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5131,8 +5131,7 @@ static ssize_t __nfs4_get_acl_uncached(s if (buf && ret > buflen) ret = -ERANGE; out: - if (priv_buf) - kfree(priv_buf); + kfree(priv_buf); return ret; }