linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Mark Fasheh <mfasheh@suse.de>
Cc: kbuild-all@01.org, Josef Bacik <jbacik@fb.com>,
	linux-btrfs@vger.kernel.org
Subject: [PATCH] fix ifnullfree.cocci warnings
Date: Wed, 23 Sep 2015 01:54:26 +0800	[thread overview]
Message-ID: <20150922175426.GA62109@xian> (raw)
In-Reply-To: <201509230124.0LoGc02q%fengguang.wu@intel.com>

fs/btrfs/qgroup.c:1463: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: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 qgroup.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1459,8 +1459,7 @@ struct btrfs_qgroup_extent_record *btrfs
 
 void btrfs_qgroup_free_extent_record(struct btrfs_qgroup_extent_record *record)
 {
-	if (record)
-		kfree(record);
+	kfree(record);
 }
 
 struct btrfs_qgroup_extent_record

      reply	other threads:[~2015-09-22 17:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 17:54 [josef-btrfs:enospc-rework 1/9] fs/btrfs/qgroup.c:1463: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 kbuild test robot
2015-09-22 17:54 ` kbuild test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150922175426.GA62109@xian \
    --to=fengguang.wu@intel.com \
    --cc=jbacik@fb.com \
    --cc=kbuild-all@01.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mfasheh@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).