diff options
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r-- | kernel/posix-timers.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 3dfd15aecc60..bd9c931b3659 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -540,11 +540,10 @@ sys_timer_create(const clockid_t which_clock, | |||
540 | */ | 540 | */ |
541 | spin_lock_irqsave(&process->sighand->siglock, flags); | 541 | spin_lock_irqsave(&process->sighand->siglock, flags); |
542 | if (!(process->flags & PF_EXITING)) { | 542 | if (!(process->flags & PF_EXITING)) { |
543 | get_task_struct(process); | ||
543 | new_timer->it_process = process; | 544 | new_timer->it_process = process; |
544 | list_add(&new_timer->list, | 545 | list_add(&new_timer->list, |
545 | &process->signal->posix_timers); | 546 | &process->signal->posix_timers); |
546 | if (new_timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID)) | ||
547 | get_task_struct(process); | ||
548 | spin_unlock_irqrestore(&process->sighand->siglock, flags); | 547 | spin_unlock_irqrestore(&process->sighand->siglock, flags); |
549 | } else { | 548 | } else { |
550 | spin_unlock_irqrestore(&process->sighand->siglock, flags); | 549 | spin_unlock_irqrestore(&process->sighand->siglock, flags); |
@@ -561,6 +560,7 @@ sys_timer_create(const clockid_t which_clock, | |||
561 | new_timer->it_sigev_signo = SIGALRM; | 560 | new_timer->it_sigev_signo = SIGALRM; |
562 | new_timer->it_sigev_value.sival_int = new_timer->it_id; | 561 | new_timer->it_sigev_value.sival_int = new_timer->it_id; |
563 | process = current->group_leader; | 562 | process = current->group_leader; |
563 | get_task_struct(process); | ||
564 | spin_lock_irqsave(&process->sighand->siglock, flags); | 564 | spin_lock_irqsave(&process->sighand->siglock, flags); |
565 | new_timer->it_process = process; | 565 | new_timer->it_process = process; |
566 | list_add(&new_timer->list, &process->signal->posix_timers); | 566 | list_add(&new_timer->list, &process->signal->posix_timers); |
@@ -853,8 +853,7 @@ retry_delete: | |||
853 | * This keeps any tasks waiting on the spin lock from thinking | 853 | * This keeps any tasks waiting on the spin lock from thinking |
854 | * they got something (see the lock code above). | 854 | * they got something (see the lock code above). |
855 | */ | 855 | */ |
856 | if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID)) | 856 | put_task_struct(timer->it_process); |
857 | put_task_struct(timer->it_process); | ||
858 | timer->it_process = NULL; | 857 | timer->it_process = NULL; |
859 | 858 | ||
860 | unlock_timer(timer, flags); | 859 | unlock_timer(timer, flags); |
@@ -881,8 +880,7 @@ retry_delete: | |||
881 | * This keeps any tasks waiting on the spin lock from thinking | 880 | * This keeps any tasks waiting on the spin lock from thinking |
882 | * they got something (see the lock code above). | 881 | * they got something (see the lock code above). |
883 | */ | 882 | */ |
884 | if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID)) | 883 | put_task_struct(timer->it_process); |
885 | put_task_struct(timer->it_process); | ||
886 | timer->it_process = NULL; | 884 | timer->it_process = NULL; |
887 | 885 | ||
888 | unlock_timer(timer, flags); | 886 | unlock_timer(timer, flags); |