Showing error 1034

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: kernel/futex.c
Line in file: 978
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Stanse (1.2)
Entered: 2012-03-04 17:07:06 UTC


Source:

 948                         * requeue.
 949                         */
 950                        if (likely(head1 != &hb2->chain)) {
 951                                plist_del(&this->list, &hb1->chain);
 952                                plist_add(&this->list, &hb2->chain);
 953                                this->lock_ptr = &hb2->lock;
 954#ifdef CONFIG_DEBUG_PI_LIST
 955                                this->list.plist.lock = &hb2->lock;
 956#endif
 957                        }
 958                        this->key = key2;
 959                        get_futex_key_refs(&key2);
 960                        drop_count++;
 961
 962                        if (ret - nr_wake >= nr_requeue)
 963                                break;
 964                }
 965        }
 966
 967out_unlock:
 968        spin_unlock(&hb1->lock);
 969        if (hb1 != hb2)
 970                spin_unlock(&hb2->lock);
 971
 972        /* drop_futex_key_refs() must be called outside the spinlocks. */
 973        while (--drop_count >= 0)
 974                drop_futex_key_refs(&key1);
 975
 976out:
 977        futex_unlock_mm(fshared);
 978        return ret;
 979}
 980
 981/* The key must be already stored in q->key. */
 982static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
 983{
 984        struct futex_hash_bucket *hb;
 985
 986        init_waitqueue_head(&q->waiters);
 987
 988        get_futex_key_refs(&q->key);
Show full sources