Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7003
b: refs/heads/master
c: dd5d666
h: refs/heads/master
i:
  7001: 11d010c
  6999: f37101b
v: v3
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Sep 5, 2005
1 parent 114cff6 commit 98196e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ed9fcec85d5ef0e34ea18affe95e4a246714565
refs/heads/master: dd5d666b7995e542b7f81a4bb1c7ad634f4f6c51
10 changes: 9 additions & 1 deletion trunk/kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,12 @@ static int software_resume(void)
{
int error;

down(&pm_sem);
if (!swsusp_resume_device) {
if (!strlen(resume_file))
if (!strlen(resume_file)) {
up(&pm_sem);
return -ENOENT;
}
swsusp_resume_device = name_to_dev_t(resume_file);
pr_debug("swsusp: Resume From Partition %s\n", resume_file);
} else {
Expand All @@ -248,6 +251,7 @@ static int software_resume(void)
* FIXME: If noresume is specified, we need to find the partition
* and reset it back to normal swap space.
*/
up(&pm_sem);
return 0;
}

Expand Down Expand Up @@ -284,6 +288,8 @@ static int software_resume(void)
Cleanup:
unprepare_processes();
Done:
/* For success case, the suspend path will release the lock */
up(&pm_sem);
pr_debug("PM: Resume from disk failed.\n");
return 0;
}
Expand Down Expand Up @@ -390,7 +396,9 @@ static ssize_t resume_store(struct subsystem * subsys, const char * buf, size_t
if (sscanf(buf, "%u:%u", &maj, &min) == 2) {
res = MKDEV(maj,min);
if (maj == MAJOR(res) && min == MINOR(res)) {
down(&pm_sem);
swsusp_resume_device = res;
up(&pm_sem);
printk("Attempting manual resume\n");
noresume = 0;
software_resume();
Expand Down

0 comments on commit 98196e3

Please sign in to comment.