Skip to content

Commit

Permalink
Merge branch 'pm-sleep'
Browse files Browse the repository at this point in the history
Merge hibernation-related fixes for 5.16-rc3.

* pm-sleep:
  PM: hibernate: Fix snapshot partial write lengths
  PM: hibernate: use correct mode for swsusp_close()
  • Loading branch information
rafaeljw committed Nov 26, 2021
2 parents 03c8398 + 88a5045 commit 7803516
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions kernel/power/hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ static int load_image_and_restore(void)
goto Unlock;

error = swsusp_read(&flags);
swsusp_close(FMODE_READ);
swsusp_close(FMODE_READ | FMODE_EXCL);
if (!error)
error = hibernation_restore(flags & SF_PLATFORM_MODE);

Expand Down Expand Up @@ -983,7 +983,7 @@ static int software_resume(void)
/* The snapshot device should not be opened while we're running */
if (!hibernate_acquire()) {
error = -EBUSY;
swsusp_close(FMODE_READ);
swsusp_close(FMODE_READ | FMODE_EXCL);
goto Unlock;
}

Expand Down Expand Up @@ -1018,7 +1018,7 @@ static int software_resume(void)
pm_pr_dbg("Hibernation image not present or could not be loaded.\n");
return error;
Close_Finish:
swsusp_close(FMODE_READ);
swsusp_close(FMODE_READ | FMODE_EXCL);
goto Finish;
}

Expand Down
2 changes: 1 addition & 1 deletion kernel/power/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
if (res <= 0)
goto unlock;
} else {
res = PAGE_SIZE - pg_offp;
res = PAGE_SIZE;
}

if (!data_of(data->handle)) {
Expand Down

0 comments on commit 7803516

Please sign in to comment.