qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: edward.shishkin@gmail.com
To: Eric Van Hensbergen <ericvh@gmail.com>,
	V9FS Developers Mailing List
	<v9fs-developer@lists.sourceforge.net>,
	Linux Filesystem Development List <linux-fsdevel@vger.kernel.org>
Cc: QEMU Developers Mailing List <qemu-devel@nongnu.org>,
	ZhangWei <zhangwei555@huawei.com>,
	Claudio Fontana <Claudio.Fontana@huawei.com>,
	Greg Kurz <groug@kaod.org>, Alexander Graf <agraf@suse.de>,
	kbuild test robot <fengguang.wu@intel.com>,
	Eduard Shishkin <eduard.shishkin@huawei.com>
Subject: [Qemu-devel] [PATCH 3/7] 9p: v9fs fix ifnullfree.cocci warnings
Date: Mon, 12 Dec 2016 19:15:38 +0100	[thread overview]
Message-ID: <1481566542-25894-3-git-send-email-edward.shishkin@gmail.com> (raw)
In-Reply-To: <1481566542-25894-1-git-send-email-edward.shishkin@gmail.com>

From: kbuild test robot <fengguang.wu@intel.com>

fs/9p/v9fs.c:318: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.
fs/9p/v9fs.c:320: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

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Eduard Shishkin <eduard.shishkin@huawei.com>
---
 fs/9p/v9fs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 3b49daf..e2f84a6 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -314,10 +314,8 @@ void put_flush_set(struct v9fs_flush_set *fset)
 {
 	if (!fset)
 		return;
-	if (fset->pages)
-		kfree(fset->pages);
-	if (fset->buf)
-		kfree(fset->buf);
+	kfree(fset->pages);
+	kfree(fset->buf);
 	kfree(fset);
 }
 
-- 
2.7.4

  parent reply	other threads:[~2016-12-12 18:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 17:24 [Qemu-devel] [RFC][PATCH 0/2] 9p: v9fs read and write speedup Edward Shishkin
2016-10-10 17:24 ` [Qemu-devel] [PATCH 1/2] 9p: v9fs add writepages Edward Shishkin
2016-10-10 17:24   ` [Qemu-devel] [PATCH 2/2] 9p: v9fs new readpages Edward Shishkin
2016-10-25 14:13     ` Alexander Graf
2016-12-09 18:42       ` Edward Shishkin
2016-10-25 14:01   ` [Qemu-devel] [PATCH 1/2] 9p: v9fs add writepages Alexander Graf
2016-12-09 18:43     ` Edward Shishkin
2016-12-12 18:13 ` [Qemu-devel] [RFC][PATCH 0/7] 9p: v9fs read and write speedup - V2 Edward Shishkin
2016-12-12 18:15   ` [Qemu-devel] [PATCH 1/7] 9p: v9fs add writepages edward.shishkin
2016-12-12 18:15     ` [Qemu-devel] [PATCH 2/7] 9p: v9fs new readpages edward.shishkin
2016-12-12 18:15     ` edward.shishkin [this message]
2016-12-12 18:15     ` [Qemu-devel] [PATCH 4/7] 9p: v9fs fix odd_ptr_err.cocci warnings edward.shishkin
2016-12-12 18:15     ` [Qemu-devel] [PATCH 5/7] 9p: v9fs fix semicolon.cocci warnings edward.shishkin
2016-12-12 18:15     ` [Qemu-devel] [PATCH 6/7] 9p: v9fs fix readpages writepages contexts allocation edward.shishkin
2016-12-12 18:15     ` [Qemu-devel] [PATCH 7/7] 9p: v9fs fix calculation of max number of merged pages edward.shishkin

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=1481566542-25894-3-git-send-email-edward.shishkin@gmail.com \
    --to=edward.shishkin@gmail.com \
    --cc=Claudio.Fontana@huawei.com \
    --cc=agraf@suse.de \
    --cc=eduard.shishkin@huawei.com \
    --cc=ericvh@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=groug@kaod.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    --cc=zhangwei555@huawei.com \
    /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).