public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't explode on swsusp failure to find swap
@ 2005-05-31  7:13 Benjamin Herrenschmidt
  2005-05-31 10:36 ` Pavel Machek
  0 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2005-05-31  7:13 UTC (permalink / raw)
  To: Linux-pm mailing list; +Cc: Pavel Machek, Linux Kernel list

Hi !

If we specify a swap device for swsusp using resume= kernel argument and
that device doesn't exist in the swap list, we end up calling
swsusp_free() before we have allocated pagedir_save. That causes us to
explode when trying to free it.

Pavel, does that look right ?

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/kernel/power/swsusp.c
===================================================================
--- linux-work.orig/kernel/power/swsusp.c	2005-05-31 16:29:22.000000000 +1000
+++ linux-work/kernel/power/swsusp.c	2005-05-31 16:57:30.000000000 +1000
@@ -730,10 +730,13 @@
 
 void swsusp_free(void)
 {
+	if (pagedir_save == NULL)
+		return;
 	BUG_ON(PageNosave(virt_to_page(pagedir_save)));
 	BUG_ON(PageNosaveFree(virt_to_page(pagedir_save)));
 	free_image_pages();
 	free_pagedir(pagedir_save);
+	pagedir_save = NULL;
 }
 
 



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-06-01 20:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-31  7:13 [PATCH] Don't explode on swsusp failure to find swap Benjamin Herrenschmidt
2005-05-31 10:36 ` Pavel Machek
2005-05-31 14:45   ` Benjamin Herrenschmidt
2005-05-31 23:50     ` Benjamin Herrenschmidt
2005-06-01  6:52       ` [linux-pm] " Shaohua Li
2005-06-01  9:29         ` Pavel Machek
2005-06-01  9:27       ` Pavel Machek
2005-06-01 19:20         ` [linux-pm] " Rafael J. Wysocki
2005-06-01 20:42           ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox