mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rcutorture: remove unneeded check
@ 2020-10-09 19:47 trix
  2020-10-09 20:18 ` Paul E. McKenney
  0 siblings, 1 reply; 9+ messages in thread
From: trix @ 2020-10-09 19:47 UTC (permalink / raw)
  To: dave, paulmck, josh, rostedt, mathieu.desnoyers, jiangshanlai,
	joel, natechancellor, ndesaulniers
  Cc: linux-kernel, rcu, clang-built-linux, Tom Rix

From: Tom Rix <trix@redhat.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@redhat.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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-10-10 22:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 19:47 [PATCH] rcutorture: remove unneeded check trix
2020-10-09 20:18 ` Paul E. McKenney
2020-10-09 21:18   ` Tom Rix
2020-10-09 23:50     ` Paul E. McKenney
2020-10-10  0:24       ` Tom Rix
2020-10-10  2:57         ` Paul E. McKenney
2020-10-10  4:47           ` Tom Rix
2020-10-10 17:57           ` Paul E. McKenney
2020-10-10 18:07             ` Tom Rix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome