Commit 4c917ba9 authored by Roland McGrath's avatar Roland McGrath Committed by Linus Torvalds

[PATCH] fix task_struct leak in posix-timers

timer_create leaks task_structs.  I probably introduced this bug when I did
the cleanup making posix-timers properly per-process.  This patch fixes it.

There is also a fixup for a random indentation snafu at the end.
Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 41e4f3d8
......@@ -655,7 +655,8 @@ sys_timer_create(clockid_t which_clock,
list_add(&new_timer->list,
&process->signal->posix_timers);
spin_unlock_irqrestore(&process->sighand->siglock, flags);
get_task_struct(process);
if (new_timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
get_task_struct(process);
} else {
spin_unlock_irqrestore(&process->sighand->siglock, flags);
process = NULL;
......@@ -1107,7 +1108,7 @@ sys_timer_delete(timer_t timer_id)
if (timer->it_process) {
if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
put_task_struct(timer->it_process);
timer->it_process = NULL;
timer->it_process = NULL;
}
unlock_timer(timer, flags);
release_posix_timer(timer, IT_ID_SET);
......
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