public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86: fix panic when handling "mem={invalid}" param
@ 2011-02-04  1:38 Kamal Mostafa
  2011-02-04  1:38 ` [PATCH 2/2] x86: "mem=nopentium ignored" warning when not supported Kamal Mostafa
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kamal Mostafa @ 2011-02-04  1:38 UTC (permalink / raw)
  To: x86
  Cc: Kamal Mostafa, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Yinghai Lu, Len Brown, Rafael J. Wysocki, linux-kernel

Avoid removing all of memory and panicing when "mem={invalid}" is
specified, e.g. mem=blahblah, mem=0, or mem=nopentium (on platforms
other than x86_32).

BugLink: http://bugs.launchpad.net/bugs/553464
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Cc: <stable@kernel.org>
---
 arch/x86/kernel/e820.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 294f26d..55a59d8 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -856,6 +856,9 @@ static int __init parse_memopt(char *p)
 
 	userdef = 1;
 	mem_size = memparse(p, &p);
+	/* don't remove all of memory when handling "mem={invalid}" param */
+	if (mem_size == 0)
+		return -EINVAL;
 	e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
 
 	return 0;
-- 
1.7.1


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

end of thread, other threads:[~2011-02-14 18:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-04  1:38 [PATCH 1/2] x86: fix panic when handling "mem={invalid}" param Kamal Mostafa
2011-02-04  1:38 ` [PATCH 2/2] x86: "mem=nopentium ignored" warning when not supported Kamal Mostafa
2011-02-14 13:54   ` [tip:x86/mm] x86: Emit " tip-bot for Kamal Mostafa
2011-02-04 19:44 ` [PATCH 1/2] x86: fix panic when handling "mem={invalid}" param Yinghai Lu
2011-02-04 20:09   ` H. Peter Anvin
2011-02-04 20:19     ` Yinghai Lu
2011-02-04 20:20       ` H. Peter Anvin
2011-02-14 13:54 ` [tip:x86/mm] x86: Fix " tip-bot for Kamal Mostafa

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