From: Oleg Nesterov Date: Fri, 23 Apr 2010 17:18:01 +0000 (-0400) Subject: rmap: anon_vma_prepare() can leak anon_vma_chain X-Git-Tag: v2.6.34-rc6~42 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31f2b0ebc01fd332cb0997f7ce9f9cde29af9e20;p=pandora-kernel.git 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 Reviewed-by: Rik van Riel Cc: Hugh Dickins Cc: Pete Zaitcev Cc: Borislav Petkov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed