Showing error 1178

User: Jiri Slaby
Error type: Double Unlock
Error type description: Some lock is unlocked twice unintentionally in a sequence
File location: kernel/futex.c
Line in file: 970
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-30 10:52:00 UTC


Source:

 940        plist_for_each_entry_safe(this, next, head1, list) {
 941                if (!match_futex (&this->key, &key1))
 942                        continue;
 943                if (++ret <= nr_wake) {
 944                        wake_futex(this);
 945                } else {
 946                        /*
 947                         * If key1 and key2 hash to the same bucket, no need to
 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
Show full sources