rcutorture: Don't cpuhp_remove_state() if cpuhp_setup_state() failed
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 6 Aug 2021 15:57:26 +0000 (08:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:22 +0000 (14:23 +0200)
commit489b93ac63d2e6982293dca7fdf7aaf2a5f33a67
tree77350b6ae9567462396dedac6b393f7dcb7ff269
parent5a6ff3e32a0c3a1e87c6b08eb62d650a992b4062
rcutorture: Don't cpuhp_remove_state() if cpuhp_setup_state() failed

[ Upstream commit fd13fe16db0d82612b260640f4e26f6d9d1e11fd ]

Currently, in CONFIG_RCU_BOOST kernels, if the rcu_torture_init()
function's call to cpuhp_setup_state() fails, rcu_torture_cleanup()
gamely passes nonsense to cpuhp_remove_state().  This results in
strange and misleading splats.  This commit therefore ensures that if
the rcu_torture_init() function's call to cpuhp_setup_state() fails,
rcu_torture_cleanup() avoids invoking cpuhp_remove_state().

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/rcu/rcutorture.c