aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-05-01 08:58:46 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 08:58:46 -0700
commitc4005e4f661a9ec8d91720a6b570865d060afcaf (patch)
tree28fef4260af585b8fc708662eddefef9bdb828de /arch
parent[PATCH] ppc64: remove unnecessary include (diff)
downloadlinux-dev-c4005e4f661a9ec8d91720a6b570865d060afcaf.tar.xz
linux-dev-c4005e4f661a9ec8d91720a6b570865d060afcaf.zip
[PATCH] ppc64: firmware workaround
Recent gcc 4.0 testing uncovered a firmware issue. Some properties are larger than 31 bytes and due to gcc 4.0s better stack allocation this overflow ran over non volatile register storage. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc64/kernel/prom_init.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index b0b784f9a4ea..35ec42de962e 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -1555,6 +1555,12 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
}
}
+/*
+ * The Open Firmware 1275 specification states properties must be 31 bytes or
+ * less, however not all firmwares obey this. Make it 64 bytes to be safe.
+ */
+#define MAX_PROPERTY_NAME 64
+
static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
unsigned long *mem_end)
{
@@ -1564,7 +1570,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
unsigned long soff;
unsigned char *valp;
unsigned long offset = reloc_offset();
- char pname[32];
+ char pname[MAX_PROPERTY_NAME];
char *path;
path = RELOC(prom_scratch);