[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201009194736.2364-1-trix@redhat.com>
Date: Fri, 9 Oct 2020 12:47:36 -0700
From: trix@...hat.com
To: dave@...olabs.net, paulmck@...nel.org, josh@...htriplett.org,
rostedt@...dmis.org, mathieu.desnoyers@...icios.com,
jiangshanlai@...il.com, joel@...lfernandes.org,
natechancellor@...il.com, ndesaulniers@...gle.com
Cc: linux-kernel@...r.kernel.org, rcu@...r.kernel.org,
clang-built-linux@...glegroups.com, Tom Rix <trix@...hat.com>
Subject: [PATCH] rcutorture: remove unneeded check
From: Tom Rix <trix@...hat.com>
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@...hat.com>
---
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
Powered by blists - more mailing lists