public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow
@ 2009-04-10 17:36 Jaswinder Singh Rajput
  2009-04-10 17:50 ` Cyrill Gorcunov
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Jaswinder Singh Rajput @ 2009-04-10 17:36 UTC (permalink / raw)
  To: Ingo Molnar, x86 maintainers, Pavel Machek, LKML

Impact: fix overflow

Constant 0x123456789abcdef0 is so big for a long.
So using saved_magic 0x12345678 for both 32 and 64 bit.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 arch/x86/kernel/acpi/sleep.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 7c243a2..1ad317a 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -94,7 +94,6 @@ int acpi_save_state_mem(void)
 #ifndef CONFIG_64BIT
 	header->pmode_entry = (u32)&wakeup_pmode_return;
 	header->pmode_cr3 = (u32)(swsusp_pg_dir - __PAGE_OFFSET);
-	saved_magic = 0x12345678;
 #else /* CONFIG_64BIT */
 	header->trampoline_segment = setup_trampoline() >> 4;
 #ifdef CONFIG_SMP
@@ -104,8 +103,8 @@ int acpi_save_state_mem(void)
 	initial_gs = per_cpu_offset(smp_processor_id());
 #endif
 	initial_code = (unsigned long)wakeup_long64;
-	saved_magic = 0x123456789abcdef0;
 #endif /* CONFIG_64BIT */
+	saved_magic = 0x12345678;
 
 	return 0;
 }
-- 
1.6.0.6




^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-04-12 17:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-10 17:36 [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow Jaswinder Singh Rajput
2009-04-10 17:50 ` Cyrill Gorcunov
2009-04-10 17:53 ` Ray Lee
2009-04-10 17:55 ` Pavel Machek
2009-04-10 18:05   ` Jaswinder Singh Rajput
2009-04-10 18:11     ` Pavel Machek
2009-04-10 18:14     ` Cyrill Gorcunov
2009-04-10 18:15     ` Jaswinder Singh Rajput
2009-04-10 19:13   ` Sam Ravnborg
2009-04-10 19:16     ` Jaswinder Singh Rajput
2009-04-10 19:29       ` Sam Ravnborg
2009-04-10 19:49         ` Jaswinder Singh Rajput
2009-04-10 20:15           ` Pavel Machek
2009-04-12 17:25             ` Rafael J. Wysocki
2009-04-12 17:30               ` Ingo Molnar
2009-04-10 19:51       ` Thomas Gleixner
2009-04-10 18:13 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox