lkml.org 
[lkml]   [2014]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH tip/core/rcu 50/55] rcutorture: Gracefully handle NULL cleanup hooks
Date
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

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>
---
kernel/torture.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/torture.c b/kernel/torture.c
index a93ee5722b50..0abaa8354bbe 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;
}
--
1.8.1.5


\
 
 \ /
  Last update: 2014-02-18 07:21    [W:1.812 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site