From 605886995a0b84fa23876c1d99485743ef2eef99 Mon Sep 17 00:00:00 2001 From: Jon Masters Date: Thu, 22 Oct 2009 19:33:56 +0200 Subject: [PATCH] hwlat: Fix Kconfig and check kthread_stop result commit d9a4a1d04d0b5ba138a6a5b25013187d4614de4d in tip. Signed-off-by: Jon Masters Signed-off-by: John Kacur Cc: Jon Masters Cc: Clark Williams Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- drivers/misc/Kconfig | 2 +- drivers/misc/hwlat_detector.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 125e995..2d883bb 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -93,7 +93,7 @@ config IBM_ASM config HWLAT_DETECTOR tristate "Testing module to detect hardware-induced latencies" depends on DEBUG_FS - select RING_BUFFER + depends on RING_BUFFER default m ---help--- A simple hardware latency detector. Use this module to detect diff --git a/drivers/misc/hwlat_detector.c b/drivers/misc/hwlat_detector.c index be6553f..d9549e9 100644 --- a/drivers/misc/hwlat_detector.c +++ b/drivers/misc/hwlat_detector.c @@ -607,7 +607,11 @@ static ssize_t debug_enable_fwrite(struct file *filp, if (!enabled) goto unlock; enabled = 0; - stop_kthread(); + err = stop_kthread(); + if (err) { + printk(KERN_ERR BANNER "cannot stop kthread\n"); + return -EFAULT; + } wake_up(&data.wq); /* reader(s) should return */ } unlock: @@ -1194,9 +1198,13 @@ out: */ static void detector_exit(void) { + int err; + if (enabled) { enabled = 0; - stop_kthread(); + err = stop_kthread(); + if (err) + printk(KERN_ERR BANNER "cannot stop kthread\n"); } free_debugfs(); -- 1.7.0.4