]> err.no Git - linux-2.6/commitdiff
[PATCH] swswsup: return correct load_image error
authorCon Kolivas <kernel@kolivas.org>
Sun, 26 Mar 2006 09:37:11 +0000 (01:37 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 26 Mar 2006 16:56:55 +0000 (08:56 -0800)
If there's an error in load_image() we should return that without checking
snapshot_image_loaded.

Signed-off-by: Con Kolivas <kernel@kolivas.org>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/power/swap.c

index 9177f3f73a6ce8bff9e0b03249786d1a64c43acc..044b8e0c102547fe909e1d25142dad3c311ad4f8 100644 (file)
@@ -454,10 +454,11 @@ static int load_image(struct swap_map_handle *handle,
                        nr_pages++;
                }
        } while (ret > 0);
-       if (!error)
+       if (!error) {
                printk("\b\b\b\bdone\n");
-       if (!snapshot_image_loaded(snapshot))
-               error = -ENODATA;
+               if (!snapshot_image_loaded(snapshot))
+                       error = -ENODATA;
+       }
        return error;
 }