[PATCH] swsusp: Improve handling of highmem
[powerpc.git] / kernel / power / user.c
index 05c58a2..a63b25c 100644 (file)
@@ -194,12 +194,12 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
                break;
 
        case SNAPSHOT_ATOMIC_RESTORE:
+               snapshot_write_finalize(&data->handle);
                if (data->mode != O_WRONLY || !data->frozen ||
                    !snapshot_image_loaded(&data->handle)) {
                        error = -EPERM;
                        break;
                }
-               snapshot_free_unused_memory(&data->handle);
                down(&pm_sem);
                pm_prepare_console();
                suspend_console();