futex: fix reference leak
authorPeter Zijlstra <peterz@infradead.org>
Wed, 11 Feb 2009 17:10:10 +0000 (18:10 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 11 Feb 2009 17:24:08 +0000 (18:24 +0100)
commit2fff78c784ed97a8e5aa225ef5228f0a6d862d82
tree2adfba52dbd8e410909a538b7c27189932acc995
parent6c6f1f0f4db31a192916eaa31ec2f114fda7d5e5
futex: fix reference leak

Catalin noticed that (38d47c1b7075: futex: rely on get_user_pages() for
shared futexes) caused an mm_struct leak.

Some tracing with the function graph tracer quickly pointed out that
futex_wait() has exit paths with unbalanced reference counts.

This regression was discovered by kmemleak.

Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/futex.c