summaryrefslogtreecommitdiff
path: root/linux/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/timer.c')
-rw-r--r--linux/timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/timer.c b/linux/timer.c
index 11a2fd8d..eb937863 100644
--- a/linux/timer.c
+++ b/linux/timer.c
@@ -312,6 +312,8 @@ static void timers_init(void)
__attribute__((destructor(103)))
static void timers_cleanup(void)
{
+ get_task_struct(timer_task);
+
pthread_mutex_lock(&timer_lock);
timer_thread_stop = true;
pthread_cond_signal(&timer_cond);
@@ -320,5 +322,6 @@ static void timers_cleanup(void)
int ret = kthread_stop(timer_task);
BUG_ON(ret);
+ put_task_struct(timer_task);
timer_task = NULL;
}