diff options
Diffstat (limited to 'kernel/power/snapshot.c')
-rw-r--r-- | kernel/power/snapshot.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 98c3b34a4cff..b38109e204af 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -792,7 +792,8 @@ void free_basic_memory_bitmaps(void) | |||
792 | { | 792 | { |
793 | struct memory_bitmap *bm1, *bm2; | 793 | struct memory_bitmap *bm1, *bm2; |
794 | 794 | ||
795 | BUG_ON(!(forbidden_pages_map && free_pages_map)); | 795 | if (WARN_ON(!(forbidden_pages_map && free_pages_map))) |
796 | return; | ||
796 | 797 | ||
797 | bm1 = forbidden_pages_map; | 798 | bm1 = forbidden_pages_map; |
798 | bm2 = free_pages_map; | 799 | bm2 = free_pages_map; |
@@ -1402,7 +1403,11 @@ int hibernate_preallocate_memory(void) | |||
1402 | * highmem and non-highmem zones separately. | 1403 | * highmem and non-highmem zones separately. |
1403 | */ | 1404 | */ |
1404 | pages_highmem = preallocate_image_highmem(highmem / 2); | 1405 | pages_highmem = preallocate_image_highmem(highmem / 2); |
1405 | alloc = (count - max_size) - pages_highmem; | 1406 | alloc = count - max_size; |
1407 | if (alloc > pages_highmem) | ||
1408 | alloc -= pages_highmem; | ||
1409 | else | ||
1410 | alloc = 0; | ||
1406 | pages = preallocate_image_memory(alloc, avail_normal); | 1411 | pages = preallocate_image_memory(alloc, avail_normal); |
1407 | if (pages < alloc) { | 1412 | if (pages < alloc) { |
1408 | /* We have exhausted non-highmem pages, try highmem. */ | 1413 | /* We have exhausted non-highmem pages, try highmem. */ |