Skip to content

Commit

Permalink
[PATCH] swsusp: do not trigger BUG_ON() if there is not enough memory
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Sep 23, 2005
1 parent 4c87b74 commit 57487f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/power/swsusp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -940,7 +941,6 @@ static int swsusp_alloc(void)
return error;
}

nr_copy_pages_check = nr_copy_pages;
return 0;
}

Expand Down

0 comments on commit 57487f4

Please sign in to comment.