aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r--kernel/power/disk.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 761956e813f5..44ef5e799df0 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -30,7 +30,6 @@ extern int swsusp_check(void);
30extern int swsusp_read(void); 30extern int swsusp_read(void);
31extern void swsusp_close(void); 31extern void swsusp_close(void);
32extern int swsusp_resume(void); 32extern int swsusp_resume(void);
33extern int swsusp_free(void);
34 33
35 34
36static int noresume = 0; 35static int noresume = 0;
@@ -252,14 +251,17 @@ static int software_resume(void)
252 251
253 pr_debug("PM: Reading swsusp image.\n"); 252 pr_debug("PM: Reading swsusp image.\n");
254 253
255 if ((error = swsusp_read())) 254 if ((error = swsusp_read())) {
256 goto Cleanup; 255 swsusp_free();
256 goto Thaw;
257 }
257 258
258 pr_debug("PM: Preparing devices for restore.\n"); 259 pr_debug("PM: Preparing devices for restore.\n");
259 260
260 if ((error = device_suspend(PMSG_FREEZE))) { 261 if ((error = device_suspend(PMSG_FREEZE))) {
261 printk("Some devices failed to suspend\n"); 262 printk("Some devices failed to suspend\n");
262 goto Free; 263 swsusp_free();
264 goto Thaw;
263 } 265 }
264 266
265 mb(); 267 mb();
@@ -268,9 +270,7 @@ static int software_resume(void)
268 swsusp_resume(); 270 swsusp_resume();
269 pr_debug("PM: Restore failed, recovering.n"); 271 pr_debug("PM: Restore failed, recovering.n");
270 device_resume(); 272 device_resume();
271 Free: 273 Thaw:
272 swsusp_free();
273 Cleanup:
274 unprepare_processes(); 274 unprepare_processes();
275 Done: 275 Done:
276 /* For success case, the suspend path will release the lock */ 276 /* For success case, the suspend path will release the lock */