lkml.org 
[lkml]   [2011]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [128/275] PM / Hibernate: Return error code when alloc_image_page() fails
Date
2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Stanislaw Gruszka <stf_xl@pop3.wp.pl>

commit 2e725a065b0153f0c449318da1923a120477633d upstream.

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 <stf_xl@wp.pl>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
kernel/power/snapshot.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

Index: linux-2.6.35.y/kernel/power/snapshot.c
===================================================================
--- linux-2.6.35.y.orig/kernel/power/snapshot.c 2011-03-29 22:51:16.709295620 -0700
+++ linux-2.6.35.y/kernel/power/snapshot.c 2011-03-29 23:53:44.733393061 -0700
@@ -1512,11 +1512,8 @@
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;
@@ -1539,7 +1536,7 @@

err_out:
swsusp_free();
- return error;
+ return -ENOMEM;
}

asmlinkage int swsusp_save(void)

\
 
 \ /
  Last update: 2011-03-30 23:47    [W:1.085 / U:30.608 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site