aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/swap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 9b2ee5344dee..1a3b0dd2c3fc 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -425,7 +425,8 @@ static int submit(int rw, pgoff_t page_off, struct page *page,
425 bio_set_pages_dirty(bio); 425 bio_set_pages_dirty(bio);
426 bio_put(bio); 426 bio_put(bio);
427 } else { 427 } else {
428 get_page(page); 428 if (rw == READ)
429 get_page(page); /* These pages are freed later */
429 bio->bi_private = *bio_chain; 430 bio->bi_private = *bio_chain;
430 *bio_chain = bio; 431 *bio_chain = bio;
431 submit_bio(rw | (1 << BIO_RW_SYNC), bio); 432 submit_bio(rw | (1 << BIO_RW_SYNC), bio);