summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-07 23:42:51 +0100
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-23 18:04:39 +0100
commitf881825a73543e9664c7fe7166e06f5f4d569834 (patch)
tree534328a56f9bbe9cca4dcb36d15b37dd7093e1de /kernel
parentlocktorture: Add vestigial locktorture configuration (diff)
downloadlinux-f881825a73543e9664c7fe7166e06f5f4d569834.tar.xz
linux-f881825a73543e9664c7fe7166e06f5f4d569834.zip
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: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/torture.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/torture.c b/kernel/torture.c
index b26c7b42becd..acc9afc2f26e 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -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;
}