Showing error 1116

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: kernel/posix-timers.c
Line in file: 856
Project: Linux Kernel
Project version: 2.6.28
Tools: Clang Static Analyzer (3.0)
Entered: 2012-04-17 12:29:30 UTC


Source:

 826                return -EINVAL;
 827
 828        if (timer_delete_hook(timer) == TIMER_RETRY) {
 829                unlock_timer(timer, flags);
 830                goto retry_delete;
 831        }
 832
 833        spin_lock(&current->sighand->siglock);
 834        list_del(&timer->list);
 835        spin_unlock(&current->sighand->siglock);
 836        /*
 837         * This keeps any tasks waiting on the spin lock from thinking
 838         * they got something (see the lock code above).
 839         */
 840        put_task_struct(timer->it_process);
 841        timer->it_process = NULL;
 842
 843        unlock_timer(timer, flags);
 844        release_posix_timer(timer, IT_ID_SET);
 845        return 0;
 846}
 847
 848/*
 849 * return timer owned by the process, used by exit_itimers
 850 */
 851static void itimer_delete(struct k_itimer *timer)
 852{
 853        unsigned long flags;
 854
 855retry_delete:
 856        spin_lock_irqsave(&timer->it_lock, flags);
 857
 858        if (timer_delete_hook(timer) == TIMER_RETRY) {
 859                unlock_timer(timer, flags);
 860                goto retry_delete;
 861        }
 862        list_del(&timer->list);
 863        /*
 864         * This keeps any tasks waiting on the spin lock from thinking
 865         * they got something (see the lock code above).
 866         */
Show full sources