diff options
Diffstat (limited to 'arch/ppc64/kernel/prom_init.c')
-rw-r--r-- | arch/ppc64/kernel/prom_init.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c index bc53967a8643..3de950de3671 100644 --- a/arch/ppc64/kernel/prom_init.c +++ b/arch/ppc64/kernel/prom_init.c | |||
@@ -1566,7 +1566,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, | |||
1566 | { | 1566 | { |
1567 | int l, align; | 1567 | int l, align; |
1568 | phandle child; | 1568 | phandle child; |
1569 | char *namep, *prev_name, *sstart; | 1569 | char *namep, *prev_name, *sstart, *p, *ep; |
1570 | unsigned long soff; | 1570 | unsigned long soff; |
1571 | unsigned char *valp; | 1571 | unsigned char *valp; |
1572 | unsigned long offset = reloc_offset(); | 1572 | unsigned long offset = reloc_offset(); |
@@ -1588,6 +1588,14 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, | |||
1588 | call_prom("package-to-path", 3, 1, node, namep, l); | 1588 | call_prom("package-to-path", 3, 1, node, namep, l); |
1589 | } | 1589 | } |
1590 | namep[l] = '\0'; | 1590 | namep[l] = '\0'; |
1591 | /* Fixup an Apple bug where they have bogus \0 chars in the | ||
1592 | * middle of the path in some properties | ||
1593 | */ | ||
1594 | for (p = namep, ep = namep + l; p < ep; p++) | ||
1595 | if (*p == '\0') { | ||
1596 | memmove(p, p+1, ep - p); | ||
1597 | ep--; l--; | ||
1598 | } | ||
1591 | *mem_start = _ALIGN(((unsigned long) namep) + strlen(namep) + 1, 4); | 1599 | *mem_start = _ALIGN(((unsigned long) namep) + strlen(namep) + 1, 4); |
1592 | } | 1600 | } |
1593 | 1601 | ||