Skip to contentSkip to conversation

futex: fix requeue_pi key imbalance

PATCH In review Darren Hart 1 participant 2 messages Oct 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 futex: fix requeue_pi key imbalance

futex: fix requeue_pi key imbalance

From: Darren Hart <[email protected]>

If futex_wait_requeue_pi() wakes prior to requeue, we drop the reference to the source futex_key twice, once in handle_early_requeue_pi_wakeup() and once on our way out. Remove the drop from the handle_early_requeue_pi_wakeup() and keep the get/drops together in futex_wait_requeue_pi().

Cc Thomas Gleixner <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
CC Eric Dumazet <[email protected]>
CC Dinakar Guniguntala <[email protected]>
CC John Stultz <[email protected]>

---

kernel/futex.c | 1 -

1 files changed, 0 insertions(+), 1 deletions(-)
kernel/futex.c +0 -0
Index: linux-2.6.git/kernel/futex.c
===================================================================
@@ -2117,7 +2117,6 @@ int handle_early_requeue_pi_wakeup(struc
		 * Unqueue the futex_q and determine which it was.
		 */
		plist_del(&q->list, &q->list.plist);

- drop_futex_key_refs(&q->key);

		if (timeout && !timeout->task)
			ret = -ETIMEDOUT;
Signature · 3 lines
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team
#1 lore raw
Commit-ID:  da085681014fb43d67d9bf6d14bc068e9254bd49
Gitweb:     http://git.kernel.org/tip/da085681014fb43d67d9bf6d14bc068e9254bd49
Author:     Darren Hart <[email protected]>
AuthorDate: Wed, 7 Oct 2009 11:46:54 -0700
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Wed, 7 Oct 2009 21:22:03 +0200

futex: fix requeue_pi key imbalance

If futex_wait_requeue_pi() wakes prior to requeue, we drop the reference to the source futex_key twice, once in handle_early_requeue_pi_wakeup() and once on our way out.

Remove the drop from the handle_early_requeue_pi_wakeup() and keep the get/drops together in futex_wait_requeue_pi().

Cc Helge Bahmann <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Dinakar Guniguntala <[email protected]>
Cc John Stultz <[email protected]>
Cc stable-2.6.31 <[email protected]>

LKML-Reference: <[email protected]>

---
 kernel/futex.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
kernel/futex.c +0 -1
index 1e176f3..c3bb2fc 100644
@@ -2111,7 +2111,6 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
 		 * Unqueue the futex_q and determine which it was.
 		 */
 		plist_del(&q->list, &q->list.plist);
-		drop_futex_key_refs(&q->key);
 
 		if (timeout && !timeout->task)
 			ret = -ETIMEDOUT;