From: Takashi Iwai Date: Thu, 9 Dec 2010 23:16:39 +0000 (+0100) Subject: PM / Hibernate: Fix PM_POST_* notification with user-space suspend X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1497dd1d29c6a53fcd3c80f7ac8d0e0239e7389e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git PM / Hibernate: Fix PM_POST_* notification with user-space suspend 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 Signed-off-by: Rafael J. Wysocki Cc: stable@kernel.org --- diff --git a/kernel/power/user.c b/kernel/power/user.c index 1b2ea31e6bd8..c36c3b9e8a84 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -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);