aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorVernon Mauery <vernux@us.ibm.com>2006-07-01 07:35:42 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 12:55:57 -0400
commita99e4e413e1ab9f3c567b5519f5557afd786dc62 (patch)
tree31998183648206018452ae0c3c46aaa19724bd74 /kernel
parent9262e9149f346a5443300f8c451b8e7631e81a42 (diff)
[PATCH] pi-futex: fix mm_struct memory leak
lock_queue was getting called essentially twice in a row and was continually incrementing the mm_count ref count, thus causing a memory leak. Dinakar Guniguntala provided a proper fix for the problem that simply grabs the spinlock for the hash bucket queue rather than calling lock_queue. The second time we do a queue_lock in futex_lock_pi, we really only need to take the hash bucket lock. Signed-off-by: Dinakar Guniguntala <dino@in.ibm.com> Signed-off-by: Vernon Mauery <vernux@us.ibm.com> Acked-by: Paul E. McKenney <paulmck@us.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/futex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 6c91f938005d..22aa3c16ca73 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1208,7 +1208,7 @@ static int do_futex_lock_pi(u32 __user *uaddr, int detect, int trylock,
1208 } 1208 }
1209 1209
1210 down_read(&curr->mm->mmap_sem); 1210 down_read(&curr->mm->mmap_sem);
1211 hb = queue_lock(&q, -1, NULL); 1211 spin_lock(q.lock_ptr);
1212 1212
1213 /* 1213 /*
1214 * Got the lock. We might not be the anticipated owner if we 1214 * Got the lock. We might not be the anticipated owner if we