diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-07-25 04:47:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:38 -0400 |
commit | 4b7a1304267bff68260ae861784b27130e805be3 (patch) | |
tree | 65065cc702a9d73fba4a85d0bdab5ed326a5b479 | |
parent | da5ef6bb96158b0fc0d808704237a453af449124 (diff) |
posix timers: timer_delete: remove the bogus "->it_process != NULL" check
sys_timer_delete() and itimer_delete() check "timer->it_process != NULL",
this looks completely bogus. ->it_process == NULL means that this timer
is already under destruction or it is not fully initialized, this must not
happen.
sys_timer_delete: the timer is locked, and lock_timer() can't succeed
if ->it_process == NULL.
itimer_delete: it is called by exit_itimers() when there are no other
threads which can play with signal_struct->posix_timers.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Roland McGrath <roland@redhat.com>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/posix-timers.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index dbd8398ddb0b..17f53266fb67 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -856,11 +856,10 @@ retry_delete: | |||
856 | * This keeps any tasks waiting on the spin lock from thinking | 856 | * This keeps any tasks waiting on the spin lock from thinking |
857 | * they got something (see the lock code above). | 857 | * they got something (see the lock code above). |
858 | */ | 858 | */ |
859 | if (timer->it_process) { | 859 | if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID)) |
860 | if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID)) | 860 | put_task_struct(timer->it_process); |
861 | put_task_struct(timer->it_process); | 861 | timer->it_process = NULL; |
862 | timer->it_process = NULL; | 862 | |
863 | } | ||
864 | unlock_timer(timer, flags); | 863 | unlock_timer(timer, flags); |
865 | release_posix_timer(timer, IT_ID_SET); | 864 | release_posix_timer(timer, IT_ID_SET); |
866 | return 0; | 865 | return 0; |
@@ -885,11 +884,10 @@ retry_delete: | |||
885 | * This keeps any tasks waiting on the spin lock from thinking | 884 | * This keeps any tasks waiting on the spin lock from thinking |
886 | * they got something (see the lock code above). | 885 | * they got something (see the lock code above). |
887 | */ | 886 | */ |
888 | if (timer->it_process) { | 887 | if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID)) |
889 | if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID)) | 888 | put_task_struct(timer->it_process); |
890 | put_task_struct(timer->it_process); | 889 | timer->it_process = NULL; |
891 | timer->it_process = NULL; | 890 | |
892 | } | ||
893 | unlock_timer(timer, flags); | 891 | unlock_timer(timer, flags); |
894 | release_posix_timer(timer, IT_ID_SET); | 892 | release_posix_timer(timer, IT_ID_SET); |
895 | } | 893 | } |