Skip to content

Commit

Permalink
[PATCH] ppc64: firmware workaround
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
antonblanchard authored and Linus Torvalds committed May 1, 2005
1 parent 4b88e92 commit c4005e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arch/ppc64/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
Expand Down

0 comments on commit c4005e4

Please sign in to comment.