Skip to content

Commit

Permalink
PM / Hibernate: Fix PM_POST_* notification with user-space suspend
Browse files Browse the repository at this point in the history
The user-space hibernation sends a wrong notification after the image
restoration because of thinko for the file flag check.  RDONLY
corresponds to hibernation and WRONLY to restoration, confusingly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: stable@kernel.org
  • Loading branch information
tiwai authored and rjwysocki committed Dec 16, 2010
1 parent b0c3844 commit 1497dd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/power/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static int snapshot_release(struct inode *inode, struct file *filp)
free_all_swap_pages(data->swap);
if (data->frozen)
thaw_processes();
pm_notifier_call_chain(data->mode == O_WRONLY ?
pm_notifier_call_chain(data->mode == O_RDONLY ?
PM_POST_HIBERNATION : PM_POST_RESTORE);
atomic_inc(&snapshot_device_available);

Expand Down

0 comments on commit 1497dd1

Please sign in to comment.