From: Oleg Nesterov Date: Fri, 4 Sep 2015 22:48:01 +0000 (-0700) Subject: mremap: don't leak new_vma if f_op->mremap() fails X-Git-Tag: omap-for-v4.3/fixes-rc1~87^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df1eab303c836c98a79de427aa1c7d6812acaaa9;p=pandora-kernel.git mremap: don't leak new_vma if f_op->mremap() fails move_vma() can't just return if f_op->mremap() fails, we should unmap the new vma like we do if move_page_tables() fails. To avoid the code duplication this patch moves the "move entries back" under the new "if (err)" branch. Signed-off-by: Oleg Nesterov Acked-by: David Rientjes Cc: Benjamin LaHaise Cc: Hugh Dickins Cc: Jeff Moyer Cc: Kirill Shutemov Cc: Pavel Emelyanov Cc: Laurent Dufour Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed