posix-timers: fix creation race
Changes
1 files changed · +1 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| kernel/posix-timers.c | modified | +1 | −1 | View file |
kernel/posix-timers.c
View filediff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 6923ad8..7a15afb 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -547,9 +547,9 @@ sys_timer_create(const clockid_t which_clock,
new_timer->it_process = process;
list_add(&new_timer->list,
&process->signal->posix_timers);
- spin_unlock_irqrestore(&process->sighand->siglock, flags);
if (new_timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
get_task_struct(process);
+ spin_unlock_irqrestore(&process->sighand->siglock, flags);
} else {
spin_unlock_irqrestore(&process->sighand->siglock, flags);
process = NULL;