Commit d9a4a1d0 authored by Jon Masters's avatar Jon Masters Committed by Thomas Gleixner

hwlat: Fix Kconfig and check kthread_stop result

Signed-off-by: default avatarJon Masters <jcm@jonmasters.org>
Signed-off-by: default avatarJohn Kacur <jkacur@redhat.com>
Cc: Jon Masters <jcm@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 55443288
......@@ -79,7 +79,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
......
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment