Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f881825a authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcutorture: Gracefully handle NULL cleanup hooks



Although most torture tests will have some cleanup hook, it is possible
that one might not.  This commit therefore enables graceful handling of
a NULL cleanup hook during torture-test shutdown.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent 9dfa5b35
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -454,7 +454,10 @@ static int torture_shutdown(void *arg)

	VERBOSE_TOROUT_STRING("torture_shutdown task shutting down system");
	shutdown_task = NULL;	/* Avoid self-kill deadlock. */
	torture_shutdown_hook();/* Shut down the enclosing torture test. */
	if (torture_shutdown_hook)
		torture_shutdown_hook();
	else
		VERBOSE_TOROUT_STRING("No torture_shutdown_hook(), skipping.");
	kernel_power_off();	/* Shut down the system. */
	return 0;
}