Skip to content

Commit 0ae9942

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
rcu: Eliminate rcu_gp_slow_unregister() false positive
When using rcutorture as a module, there are a number of conditions that can abort the modprobe operation, for example, when attempting to run both RCU CPU stall warning tests and forward-progress tests. This can cause rcu_torture_cleanup() to be invoked on the unwind path out of rcu_rcu_torture_init(), which will mean that rcu_gp_slow_unregister() is invoked without a matching rcu_gp_slow_register(). This will cause a splat because rcu_gp_slow_unregister() is passed rcu_fwd_cb_nodelay, which does not match a NULL pointer. This commit therefore forgives a mismatch involving a NULL pointer, thus avoiding this false-positive splat. Signed-off-by: Paul E. McKenney <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent 2cbc482 commit 0ae9942

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ EXPORT_SYMBOL_GPL(rcu_gp_slow_register);
12601260
/* Unregister a counter, with NULL for not caring which. */
12611261
void rcu_gp_slow_unregister(atomic_t *rgssp)
12621262
{
1263-
WARN_ON_ONCE(rgssp && rgssp != rcu_gp_slow_suppress);
1263+
WARN_ON_ONCE(rgssp && rgssp != rcu_gp_slow_suppress && rcu_gp_slow_suppress != NULL);
12641264

12651265
WRITE_ONCE(rcu_gp_slow_suppress, NULL);
12661266
}

0 commit comments

Comments
 (0)