Skip to content

Commit

Permalink
futex: Drop refcount if requeue_pi() acquired the rtmutex
Browse files Browse the repository at this point in the history
If the proxy lock in the requeue loop acquires the rtmutex for a
waiter then it acquired also refcount on the pi_state related to the
futex, but the waiter side does not drop the reference count.

Add the missing free_pi_state() call.

Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Darren Hart <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: [email protected]
Cc: Andy Lowe <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
  • Loading branch information
KAGA-KOKO committed Dec 20, 2015
1 parent 2d142e5 commit fb75a42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -2755,6 +2755,11 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
if (q.pi_state && (q.pi_state->owner != current)) {
spin_lock(q.lock_ptr);
ret = fixup_pi_state_owner(uaddr2, &q, current);
/*
* Drop the reference to the pi state which
* the requeue_pi() code acquired for us.
*/
free_pi_state(q.pi_state);
spin_unlock(q.lock_ptr);
}
} else {
Expand Down

0 comments on commit fb75a42

Please sign in to comment.