Oleg Nesterov 31f2b0ebc0 rmap: anon_vma_prepare() can leak anon_vma_chain
If find_mergeable_anon_vma() succeeds but another thread installs
->anon_vma before we take ptl, then allocated == NULL but avc should be
freed.  Change the code to check avc != NULL to detect this case.

Also, a couple of whitespace changes to make the critical section more
visible.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-04-24 11:31:25 -07:00
..
2009-04-01 08:59:13 -07:00
2010-03-06 11:26:23 -08:00
2010-02-05 12:22:40 +01:00
2009-06-16 19:47:28 -07:00
2010-04-24 11:31:24 -07:00
2009-09-22 07:17:35 -07:00
2010-03-06 11:26:24 -08:00
2010-03-24 16:31:21 -07:00
2007-10-20 01:27:18 +02:00
2009-12-16 19:48:48 -05:00
2009-06-23 12:50:05 -07:00