srcu: Avoid NULL dereference in srcu_torture_stats_print()
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 27 Jan 2022 19:43:11 +0000 (11:43 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 24 Feb 2022 17:50:10 +0000 (09:50 -0800)
commitb54e31f75e69c508b04bab3417c8a750ef2e7a27
tree84f5c5734175f80e32e0e08ad190b9af827f6b6e
parente9436e551a54a20f13bc54b9eb0bafed8d06fe17
srcu: Avoid NULL dereference in srcu_torture_stats_print()

You really shouldn't invoke srcu_torture_stats_print() after invoking
cleanup_srcu_struct(), but there is really no reason to get a
compiler-obfuscated per-CPU-variable NULL pointer dereference as the
diagnostic.  This commit therefore checks for NULL ->sda and makes a
more polite console-message complaint in that case.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/srcutree.c