From 06219178c632d9a949029ade1a85033629365dbf Mon Sep 17 00:00:00 2001 From: Jon Masters Date: Thu, 22 Oct 2009 19:33:56 +0200 Subject: [PATCH] Updates from Jon Masters for hwlat_detector.c Signed-off-by: Jon Masters Signed-off-by: John Kacur --- 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 15cd6bc..35f441c 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -95,7 +95,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..0ffb43a 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 (0 != 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 (0 != err) + printk(KERN_ERR BANNER "cannot stop kthread\n"); } free_debugfs(); -- 1.6.0.6