[PATCH] Don't explode on swsusp failure to find swap
From: Benjamin Herrenschmidt (benh_at_kernel.crashing.org)
Date: 05/31/05
- Previous message: Andi Kleen: "Re: [RFC] x86-64: Use SSE for copy_page and clear_page"
- Next in thread: Pavel Machek: "Re: [PATCH] Don't explode on swsusp failure to find swap"
- Reply: Pavel Machek: "Re: [PATCH] Don't explode on swsusp failure to find swap"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Linux-pm mailing list <linux-pm@lists.osdl.org> Date: Tue, 31 May 2005 17:13:05 +1000
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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Andi Kleen: "Re: [RFC] x86-64: Use SSE for copy_page and clear_page"
- Next in thread: Pavel Machek: "Re: [PATCH] Don't explode on swsusp failure to find swap"
- Reply: Pavel Machek: "Re: [PATCH] Don't explode on swsusp failure to find swap"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|