[PATCH] rcutorture: remove unneeded check
From: trix
Date: Fri Oct 09 2020 - 15:47:58 EST
From: Tom Rix <trix@xxxxxxxxxx>
clang static analysis reports this problem:
rcutorture.c:1999:2: warning: Called function pointer
is null (null dereference)
cur_ops->sync(); /* Later readers see above write. */
^~~~~~~~~~~~~~~
This is a false positive triggered by an earlier, later ignored
NULL check of sync() op. By inspection of the rcu_torture_ops,
the sync() op is never uninitialized. So this earlier check is
not needed.
Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
---
kernel/rcu/rcutorture.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index beba9e7963c8..6efc03a1d623 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1989,7 +1989,7 @@ static void rcu_torture_fwd_prog_nr(struct rcu_fwd *rfp,
unsigned long stopat;
static DEFINE_TORTURE_RANDOM(trs);
- if (cur_ops->call && cur_ops->sync && cur_ops->cb_barrier) {
+ if (cur_ops->call && cur_ops->cb_barrier) {
init_rcu_head_on_stack(&fcs.rh);
selfpropcb = true;
}
--
2.18.1