Skip to contentSkip to conversation

swsusp: do not trigger BUG_ON() if there is not enough memory

PATCH In review Rafael J. Wysocki 2 participants 2 messages Sep 22, 2005

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

PATCH 1/1 swsusp: do not trigger BUG_ON() if there is not enough memory

Hi,

The following patch makes swsusp avoid triggering the BUG_ON() in swsusp_suspend() if there is not enough memory for suspend. Please apply.

Greetings,
Rafael

kernel/power/swsusp.c +1 -1
Index: linux-2.6.14-rc2/kernel/power/swsusp.c
===================================================================
@@ -918,6 +918,7 @@
 
 	pagedir_nosave = NULL;
 	nr_copy_pages = calc_nr(nr_copy_pages);
+	nr_copy_pages_check = nr_copy_pages;
 
 	pr_debug("suspend: (pages needed: %d + %d free: %d)\n",
 		 nr_copy_pages, PAGES_FOR_IO, nr_free_pages());
@@ -940,7 +941,6 @@
 		return error;
 	}
 
-	nr_copy_pages_check = nr_copy_pages;
 	return 0;
 }
 
Signature · 3 lines
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"
#1 lore raw

Hi!

Quoted 2 lines

The following patch makes swsusp avoid triggering the BUG_ON() in swsusp_suspend() if there is not enough memory for suspend. Please apply.

Patch is okay. I had fix for same problem, but it was uglyer.

Pavel

Signature · 1 line
if you have sharp zaurus hardware you don't need... you know my address