lkml.org 
[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH tip/core/rcu 15/15] kvfree_rcu(): Fix ifnullfree.cocci warnings
Date
From: kernel test robot <lkp@intel.com>

NULL check before kfree is not needed.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes: 9f7e887e648c ("rcu/tree: Allocate a page when caller is preemptible")
Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
kernel/rcu/tree.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index cc998d7..4a85ea2 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3165,8 +3165,7 @@ static void kfree_rcu_work(struct work_struct *work)
bkvhead[i] = NULL;
krc_this_cpu_unlock(krcp, flags);

- if (bkvhead[i])
- kfree(bkvhead[i]);
+ kfree(bkvhead[i]);

cond_resched_tasks_rcu_qs();
}
--
2.9.5
\
 
 \ /
  Last update: 2020-09-29 01:31    [W:0.159 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site