diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/swsusp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 1cc9ff25e479..8aef1b49150f 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c | |||
@@ -402,15 +402,14 @@ static int write_page(unsigned long addr, swp_entry_t * loc) | |||
402 | static void data_free(void) | 402 | static void data_free(void) |
403 | { | 403 | { |
404 | swp_entry_t entry; | 404 | swp_entry_t entry; |
405 | int i; | 405 | struct pbe * p; |
406 | 406 | ||
407 | for (i = 0; i < nr_copy_pages; i++) { | 407 | for_each_pbe(p, pagedir_nosave) { |
408 | entry = (pagedir_nosave + i)->swap_address; | 408 | entry = p->swap_address; |
409 | if (entry.val) | 409 | if (entry.val) |
410 | swap_free(entry); | 410 | swap_free(entry); |
411 | else | 411 | else |
412 | break; | 412 | break; |
413 | (pagedir_nosave + i)->swap_address = (swp_entry_t){0}; | ||
414 | } | 413 | } |
415 | } | 414 | } |
416 | 415 | ||