From: Guoqing Jiang <gqjiang@suse.com>
To: shli@kernel.org
Cc: neilb@suse.de, linux-raid@vger.kernel.org,
kbuild test robot <lkp@intel.com>,
Fengguang Wu <fengguang.wu@intel.com>
Subject: [V2 PATCH 13/13] md-cluster: fix ifnullfree.cocci warnings
Date: Mon, 2 May 2016 11:50:16 -0400 [thread overview]
Message-ID: <1462204216-2269-6-git-send-email-gqjiang@suse.com> (raw)
In-Reply-To: <1462204216-2269-1-git-send-email-gqjiang@suse.com>
From: kbuild test robot <lkp@intel.com>
drivers/md/bitmap.c:2049:6-11: 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
Acked-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
drivers/md/bitmap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 4a05bac..ad5a858 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -2076,8 +2076,7 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
/* deallocate the page memory */
for (k = 0; k < page; k++) {
- if (new_bp[k].map)
- kfree(new_bp[k].map);
+ kfree(new_bp[k].map);
}
/* restore some fields from old_counts */
--
2.6.6
next prev parent reply other threads:[~2016-05-02 15:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-02 15:33 [V2 PATCH 00/13] The latest patches for md-cluster Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 01/13] md-cluster: change resync lock from asynchronous to synchronous Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 02/13] md-cluser: make resync_finish only called after pers->sync_request Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 03/13] md-cluster: wake up thread to continue recovery Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 04/13] md-cluster: unregister thread if err happened Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 05/13] md-cluster: fix locking when node joins cluster during message broadcast Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 06/13] md-cluster: change array_sectors and update size are not supported Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 07/13] md-cluster: wakeup thread if activated a spare disk Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 08/13] md-cluster: always setup in-memory bitmap Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 09/13] md-cluster: sync bitmap when node received RESYNCING msg Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 10/13] md-cluster/bitmap: fix wrong calcuation of offset Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 11/13] md-cluster/bitmap: fix wrong page num in bitmap_file_clear_bit and bitmap_file_set_bit Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 12/13] md-cluster/bitmap: unplug bitmap to sync dirty pages to disk Guoqing Jiang
2016-05-02 15:50 ` Guoqing Jiang [this message]
2016-05-02 17:49 ` [V2 PATCH 00/13] The latest patches for md-cluster Shaohua Li
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=1462204216-2269-6-git-send-email-gqjiang@suse.com \
--to=gqjiang@suse.com \
--cc=fengguang.wu@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=lkp@intel.com \
--cc=neilb@suse.de \
--cc=shli@kernel.org \
/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).