diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-12-19 15:07:38 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-12-20 06:43:24 -0500 |
commit | fb75a4282d0d9a3c7c44d940582c2d226cf3acfb (patch) | |
tree | c81fbcdebe6531267922ca86dab5a74847bed6af /kernel/futex.c | |
parent | 2d142e599bf73ab70a3457e6947f86935245415e (diff) |
futex: Drop refcount if requeue_pi() acquired the rtmutex
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 <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <darren@dvhart.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Bhuvanesh_Surachari@mentor.com
Cc: Andy Lowe <Andy_Lowe@mentor.com>
Link: http://lkml.kernel.org/r/20151219200607.178132067@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 684d7549825a..24fbc7765828 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -2755,6 +2755,11 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, | |||
2755 | if (q.pi_state && (q.pi_state->owner != current)) { | 2755 | if (q.pi_state && (q.pi_state->owner != current)) { |
2756 | spin_lock(q.lock_ptr); | 2756 | spin_lock(q.lock_ptr); |
2757 | ret = fixup_pi_state_owner(uaddr2, &q, current); | 2757 | ret = fixup_pi_state_owner(uaddr2, &q, current); |
2758 | /* | ||
2759 | * Drop the reference to the pi state which | ||
2760 | * the requeue_pi() code acquired for us. | ||
2761 | */ | ||
2762 | free_pi_state(q.pi_state); | ||
2758 | spin_unlock(q.lock_ptr); | 2763 | spin_unlock(q.lock_ptr); |
2759 | } | 2764 | } |
2760 | } else { | 2765 | } else { |