Showing error 1142

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: kernel/futex.c
Line in file: 713
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-29 14:49:11 UTC


Source:

 683
 684static int unlock_futex_pi(u32 __user *uaddr, u32 uval)
 685{
 686        u32 oldval;
 687
 688        /*
 689         * There is no waiter, so we unlock the futex. The owner died
 690         * bit has not to be preserved here. We are the owner:
 691         */
 692        oldval = cmpxchg_futex_value_locked(uaddr, uval, 0);
 693
 694        if (oldval == -EFAULT)
 695                return oldval;
 696        if (oldval != uval)
 697                return -EAGAIN;
 698
 699        return 0;
 700}
 701
 702/*
 703 * Express the locking dependencies for lockdep:
 704 */
 705static inline void
 706double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2)
 707{
 708        if (hb1 <= hb2) {
 709                spin_lock(&hb1->lock);
 710                if (hb1 < hb2)
 711                        spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING);
 712        } else { /* hb1 > hb2 */
 713                spin_lock(&hb2->lock);
 714                spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING);
 715        }
 716}
 717
 718/*
 719 * Wake up all waiters hashed on the physical page that is mapped
 720 * to this virtual address:
 721 */
 722static int futex_wake(u32 __user *uaddr, struct rw_semaphore *fshared,
 723                      int nr_wake, u32 bitset)
Show full sources