aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/swap.c')
-rw-r--r--kernel/power/swap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index b101cdc4df3f..a4388624ed98 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -572,8 +572,6 @@ int swsusp_read(unsigned int *flags_p)
572 error = load_image(&handle, &snapshot, header->pages - 1); 572 error = load_image(&handle, &snapshot, header->pages - 1);
573 release_swap_reader(&handle); 573 release_swap_reader(&handle);
574 574
575 blkdev_put(resume_bdev, FMODE_READ);
576
577 if (!error) 575 if (!error)
578 pr_debug("PM: Image successfully loaded\n"); 576 pr_debug("PM: Image successfully loaded\n");
579 else 577 else
@@ -596,7 +594,7 @@ int swsusp_check(void)
596 error = bio_read_page(swsusp_resume_block, 594 error = bio_read_page(swsusp_resume_block,
597 swsusp_header, NULL); 595 swsusp_header, NULL);
598 if (error) 596 if (error)
599 return error; 597 goto put;
600 598
601 if (!memcmp(SWSUSP_SIG, swsusp_header->sig, 10)) { 599 if (!memcmp(SWSUSP_SIG, swsusp_header->sig, 10)) {
602 memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); 600 memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10);
@@ -604,8 +602,10 @@ int swsusp_check(void)
604 error = bio_write_page(swsusp_resume_block, 602 error = bio_write_page(swsusp_resume_block,
605 swsusp_header, NULL); 603 swsusp_header, NULL);
606 } else { 604 } else {
607 return -EINVAL; 605 error = -EINVAL;
608 } 606 }
607
608put:
609 if (error) 609 if (error)
610 blkdev_put(resume_bdev, FMODE_READ); 610 blkdev_put(resume_bdev, FMODE_READ);
611 else 611 else