mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
PM / Hibernate: Return error code when alloc_image_page() fails
Currently we return 0 in swsusp_alloc() when alloc_image_page() fails. Fix that. Also remove unneeded "error" variable since the only useful value of error is -ENOMEM. [rjw: Fixed up the changelog and changed subject.] Signed-off-by: Stanislaw Gruszka <[email protected]> Cc: [email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
a2640111d5
commit
2e725a065b
1 changed files with 2 additions and 5 deletions
|
|
@ -1519,11 +1519,8 @@ static int
|
|||
swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
|
||||
unsigned int nr_pages, unsigned int nr_highmem)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
if (nr_highmem > 0) {
|
||||
error = get_highmem_buffer(PG_ANY);
|
||||
if (error)
|
||||
if (get_highmem_buffer(PG_ANY))
|
||||
goto err_out;
|
||||
if (nr_highmem > alloc_highmem) {
|
||||
nr_highmem -= alloc_highmem;
|
||||
|
|
@ -1546,7 +1543,7 @@ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
|
|||
|
||||
err_out:
|
||||
swsusp_free();
|
||||
return error;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
asmlinkage int swsusp_save(void)
|
||||
|
|
|
|||
Loading…
Reference in a new issue