[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161122144844.GA70639@roam.lkp.intel.com>
Date: Tue, 22 Nov 2016 22:48:44 +0800
From: kbuild test robot <lkp@...el.com>
To: Ganesh Mahendran <opensource.ganesh@...il.com>
Cc: kbuild-all@...org, gregkh@...uxfoundation.org, arve@...roid.com,
riandrews@...roid.com, linux-kernel@...r.kernel.org,
Ganesh Mahendran <opensource.ganesh@...il.com>
Subject: [PATCH] binder: fix ifnullfree.cocci warnings
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@...il.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.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)
Powered by blists - more mailing lists