summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2005-09-22 21:44:01 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-22 22:17:35 -0700
commit57487f4376e16558ccbe45a5b41d8cb5192309a4 (patch)
tree0f2712787db8a8eb7021ccac41deef40d6890f41
parent4c87b74c72d42f7272aa4bf8f17c73bb53774eee (diff)
[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 <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--kernel/power/swsusp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index d967e875ee82..353f37f1ba28 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;
}