sh: Add a printk() to warn legacy mem= growers.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, January 28, 2008 - 4:06 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=80a68a...
Commit:     80a68a43d90e2221599b507b6b26c3cba1957687
Parent:     74d99a5e262229ee865f6f68528d10b82471ead6
Author:     Stuart Menefy <stuart.menefy@st.com>
AuthorDate: Mon Nov 26 21:16:09 2007 +0900
Committer:  Paul Mundt <lethal@linux-sh.org>
CommitDate: Mon Jan 28 13:18:57 2008 +0900

    sh: Add a printk() to warn legacy mem= growers.
    
    mem= can't be used to grow the size of kernel memory, so provide a
    warning to that effect.
    
    Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
    Signed-off-by: Paul Mundt <lethal@linux-sh.org>
---
 arch/sh/kernel/setup.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 6891cc9..7eb7fdc 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -84,6 +84,17 @@ static int __init early_parse_mem(char *p)
 
 	memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;
 	size = memparse(p, &p);
+
+	if (size > __MEMORY_SIZE) {
+		static char msg[] __initdata = KERN_ERR
+			"Using mem= to increase the size of kernel memory "
+			"is not allowed.\n"
+			"  Recompile the kernel with the correct value for "
+			"CONFIG_MEMORY_SIZE.\n";
+		printk(msg);
+		return 0;
+	}
+
 	memory_end = memory_start + size;
 
 	return 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
sh: Add a printk() to warn legacy mem= growers., Linux Kernel Mailing ..., (Mon Jan 28, 4:06 pm)