From: kbuild test robot <lkp@intel.com>
To: Ganesh Mahendran <opensource.ganesh@gmail.com>
Cc: kbuild-all@01.org, gregkh@linuxfoundation.org, arve@android.com,
riandrews@android.com, linux-kernel@vger.kernel.org,
Ganesh Mahendran <opensource.ganesh@gmail.com>
Subject: [PATCH] binder: fix ifnullfree.cocci warnings
Date: Tue, 22 Nov 2016 22:48:44 +0800 [thread overview]
Message-ID: <20161122144844.GA70639@roam.lkp.intel.com> (raw)
In-Reply-To: <1479813450-4462-1-git-send-email-opensource.ganesh@gmail.com>
drivers/android/binder.c:3705:2-20: 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.
drivers/android/binder.c:3708:2-20: 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.
drivers/android/binder.c:3711:2-20: 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.
drivers/android/binder.c:3714:2-20: 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.
drivers/android/binder.c:3717:2-20: 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.
drivers/android/binder.c:3720:2-20: 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.
drivers/android/binder.c:3723:2-20: 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: Ganesh Mahendran <opensource.ganesh@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
binder.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -3701,26 +3701,19 @@ BINDER_DEBUG_ENTRY(transaction_log);
static void binder_destroy_cache(void)
{
- if (binder_proc_cachep)
- kmem_cache_destroy(binder_proc_cachep);
+ kmem_cache_destroy(binder_proc_cachep);
- if (binder_thread_cachep)
- kmem_cache_destroy(binder_thread_cachep);
+ kmem_cache_destroy(binder_thread_cachep);
- if (binder_node_cachep)
- kmem_cache_destroy(binder_node_cachep);
+ kmem_cache_destroy(binder_node_cachep);
- if (binder_ref_cachep)
- kmem_cache_destroy(binder_ref_cachep);
+ kmem_cache_destroy(binder_ref_cachep);
- if (binder_transaction_cachep)
- kmem_cache_destroy(binder_transaction_cachep);
+ kmem_cache_destroy(binder_transaction_cachep);
- if (binder_work_cachep)
- kmem_cache_destroy(binder_work_cachep);
+ kmem_cache_destroy(binder_work_cachep);
- if (binder_ref_death_cachep)
- kmem_cache_destroy(binder_ref_death_cachep);
+ kmem_cache_destroy(binder_ref_death_cachep);
}
static int __init binder_create_cache(void)
prev parent reply other threads:[~2016-11-22 14:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-22 14:48 [PATCH] binder: replace kzalloc with kmem_cache kbuild test robot
2016-11-22 11:17 ` Ganesh Mahendran
2016-11-22 13:53 ` Greg KH
2016-12-14 2:39 ` Ganesh Mahendran
2016-12-14 11:10 ` Greg KH
2016-11-22 14:48 ` 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=20161122144844.GA70639@roam.lkp.intel.com \
--to=lkp@intel.com \
--cc=arve@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=opensource.ganesh@gmail.com \
--cc=riandrews@android.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