]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Mon, 11 Apr 2022 22:52:30 +0000 (15:52 -0700)
commit81b13aa051d26977e7719bf09f7bcf99d0fc0aab
tree8c90406b54704cd5bea6bab3c3ffe246f7e8152d
parenta0d0b6a3a4d568003c005b6e01ebba68019db7d2
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.

Co-developed-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Signed-off-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/srcutree.c