This patch fix the race condition of remove S4 sign key. It moved the
code of reload sign key to software_resume() in hibernate.c after we
confirmed the snapshot image doesn't in swap partition. We ignore the
errors, -ENOENT, -ENODEV and -NENXIO to ignore the checking result before
swap partition available. It avoid the S4 sign key removed before we
load it after S4 resume success.
Signed-off-by: Lee, Chun-Yi
---
kernel/power/hibernate.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 692c790..840c711 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -844,6 +844,8 @@ static int software_resume(void)
Unlock:
mutex_unlock(&pm_mutex);
pr_debug("PM: Hibernation image not present or could not be loaded.\n");
+ if (error && error != -ENOENT && error != -ENODEV && error != -ENXIO)
+ load_sign_key_data();
return error;
close_finish:
swsusp_close(FMODE_READ);
--
1.6.4.2
--
To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org