From: Rafael J. Wysocki Date: Fri, 23 Sep 2005 04:44:01 +0000 (-0700) Subject: [PATCH] swsusp: do not trigger BUG_ON() if there is not enough memory X-Git-Tag: v2.6.14-rc3~51^2~52 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57487f4376e16558ccbe45a5b41d8cb5192309a4;p=linux-2.6 [PATCH] swsusp: do not trigger BUG_ON() if there is not enough memory The following patch makes swsusp avoid triggering the BUG_ON() in swsusp_suspend() if there is not enough memory for suspend. Signed-off-by: Rafael J. Wysocki Cc: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index d967e875ee..353f37f1ba 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -918,6 +918,7 @@ static int swsusp_alloc(void) 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 @@ static int swsusp_alloc(void) return error; } - nr_copy_pages_check = nr_copy_pages; return 0; }