Commit 93df8966 authored by Pavel Machek's avatar Pavel Machek Committed by Linus Torvalds

[PATCH] swsusp bugfixes: fix memory leak

This fixes memory leak when we are low on memory during suspend.  Ouch and
nr_needed_pages is only used twice, and only written :-(.  I guess that can
wait for 2.6.10.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7032d83e
......@@ -786,12 +786,13 @@ static int swsusp_alloc(void)
int suspend_prepare_image(void)
{
unsigned int nr_needed_pages = 0;
unsigned int nr_needed_pages;
int error;
pr_debug("swsusp: critical section: \n");
if (save_highmem()) {
printk(KERN_CRIT "Suspend machine: Not enough free pages for highmem\n");
restore_highmem();
return -ENOMEM;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment