Skip to contentSkip to conversation

swsusp bugfixes: fix memory leak

PATCH Pavel Machek 1 participant 1 message Dec 11, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi!

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. Please apply,
Pavel

kernel/power/swsusp.c +2 -1
@@ -786,12 +768,13 @@
 
 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;
 	}
 
Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!