Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57487f43 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Linus Torvalds
Browse files

[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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4c87b74c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}