]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
PM / Hibernate: Fix snapshot error code path
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 7 Jul 2010 21:43:35 +0000 (23:43 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Mon, 19 Jul 2010 00:00:35 +0000 (02:00 +0200)
There is an inconsistency between hibernation_platform_enter()
and hibernation_snapshot(), because the latter calls
hibernation_ops->end() after failing hibernation_ops->begin(), while
the former doesn't do that.  Make hibernation_snapshot() behave in
the same way as hibernation_platform_enter() in that respect.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Len Brown <len.brown@intel.com>
kernel/power/hibernate.c

index d97ba8615c30ea1903937469ff1cf2daedb8ed4d..d26f04e927437a153b08182b6f01d2b2dfed1357 100644 (file)
@@ -330,7 +330,7 @@ int hibernation_snapshot(int platform_mode)
 
        error = platform_begin(platform_mode);
        if (error)
-               return error;
+               goto Close;
 
        /* Preallocate image memory before shutting down devices. */
        error = hibernate_preallocate_memory();