Loading kernel/power/swap.c +15 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ #define HIBERNATE_SIG "S1SUSPEND" static int goldenimage; /* * When reading an {un,}compressed image, we may restore pages in place, * in which case some architectures need these pages cleaning before they Loading Loading @@ -1531,7 +1532,13 @@ int swsusp_check(void) goto put; if (!memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) { memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); if (!goldenimage) { pr_debug("PM: corrupt hibernate image header\n"); memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); } else { pr_debug("PM: Header corruption avoided\n"); } /* Reset swap signature now */ error = hib_submit_io(WRITE_SYNC, swsusp_resume_block, swsusp_header, NULL); Loading Loading @@ -1605,3 +1612,10 @@ static int swsusp_header_init(void) } core_initcall(swsusp_header_init); static int __init golden_image_setup(char *str) { goldenimage = 1; return 1; } __setup("golden_image", golden_image_setup); Loading
kernel/power/swap.c +15 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ #define HIBERNATE_SIG "S1SUSPEND" static int goldenimage; /* * When reading an {un,}compressed image, we may restore pages in place, * in which case some architectures need these pages cleaning before they Loading Loading @@ -1531,7 +1532,13 @@ int swsusp_check(void) goto put; if (!memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) { memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); if (!goldenimage) { pr_debug("PM: corrupt hibernate image header\n"); memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); } else { pr_debug("PM: Header corruption avoided\n"); } /* Reset swap signature now */ error = hib_submit_io(WRITE_SYNC, swsusp_resume_block, swsusp_header, NULL); Loading Loading @@ -1605,3 +1612,10 @@ static int swsusp_header_init(void) } core_initcall(swsusp_header_init); static int __init golden_image_setup(char *str) { goldenimage = 1; return 1; } __setup("golden_image", golden_image_setup);