Return-Path: Received: from fieldses.org ([173.255.197.46]:33422 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933512AbdBQTeD (ORCPT ); Fri, 17 Feb 2017 14:34:03 -0500 Date: Fri, 17 Feb 2017 14:34:03 -0500 To: kbuild test robot Cc: "J. Bruce Fields" , kbuild-all@01.org, Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, Andreas Gruenbacher , Weston Andros Adamson Subject: Re: [PATCH] nfsd4: fix ifnullfree.cocci warnings Message-ID: <20170217193403.GG10894@fieldses.org> References: <201702180301.FBMzLirK%fengguang.wu@intel.com> <20170217193521.GA62045@lkp-sb04.lkp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20170217193521.GA62045@lkp-sb04.lkp.intel.com> From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org List-ID: Fixed locally.--b. On Sat, Feb 18, 2017 at 03:35:21AM +0800, kbuild test robot wrote: > 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(-) > > --- 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; > } > > -- > 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