]> git.baikalelectronics.ru Git - kernel.git/commit
kexec: fix memory leak in function kimage_normal_alloc
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>
Thu, 28 Feb 2013 01:03:29 +0000 (17:03 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Feb 2013 03:10:12 +0000 (19:10 -0800)
commitaf24c7496f11f7a69e53a1dc1c57ff3389b2d169
tree33ba2fe02e93a4af156f6425ac6dd0c5355b1980
parent5dd6a53d18940363976ac9be3494a39c69602809
kexec: fix memory leak in function kimage_normal_alloc

If kimage_normal_alloc() fails to alloc pages for image->swap_page, it
should call kimage_free_page_list() to free allocated pages in
image->control_pages list before it frees image.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/kexec.c