提交 feba070d 编写于 作者: R Rafael J. Wysocki

Merge branch 'pm-sleep'

* pm-sleep:
  PM / hibernate: Avoid overflow in hibernate_preallocate_memory()
...@@ -1402,7 +1402,11 @@ int hibernate_preallocate_memory(void) ...@@ -1402,7 +1402,11 @@ int hibernate_preallocate_memory(void)
* highmem and non-highmem zones separately. * highmem and non-highmem zones separately.
*/ */
pages_highmem = preallocate_image_highmem(highmem / 2); pages_highmem = preallocate_image_highmem(highmem / 2);
alloc = (count - max_size) - pages_highmem; alloc = count - max_size;
if (alloc > pages_highmem)
alloc -= pages_highmem;
else
alloc = 0;
pages = preallocate_image_memory(alloc, avail_normal); pages = preallocate_image_memory(alloc, avail_normal);
if (pages < alloc) { if (pages < alloc) {
/* We have exhausted non-highmem pages, try highmem. */ /* We have exhausted non-highmem pages, try highmem. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册