diff options
Diffstat (limited to 'arch/sparc/kernel/prom.c')
-rw-r--r-- | arch/sparc/kernel/prom.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c index 4b06dcb00ebd..4ca9e5fc97f4 100644 --- a/arch/sparc/kernel/prom.c +++ b/arch/sparc/kernel/prom.c | |||
@@ -444,6 +444,7 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s | |||
444 | static struct property *tmp = NULL; | 444 | static struct property *tmp = NULL; |
445 | struct property *p; | 445 | struct property *p; |
446 | int len; | 446 | int len; |
447 | const char *name; | ||
447 | 448 | ||
448 | if (tmp) { | 449 | if (tmp) { |
449 | p = tmp; | 450 | p = tmp; |
@@ -456,19 +457,21 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s | |||
456 | 457 | ||
457 | p->name = (char *) (p + 1); | 458 | p->name = (char *) (p + 1); |
458 | if (special_name) { | 459 | if (special_name) { |
460 | strcpy(p->name, special_name); | ||
459 | p->length = special_len; | 461 | p->length = special_len; |
460 | p->value = prom_early_alloc(special_len); | 462 | p->value = prom_early_alloc(special_len); |
461 | memcpy(p->value, special_val, special_len); | 463 | memcpy(p->value, special_val, special_len); |
462 | } else { | 464 | } else { |
463 | if (prev == NULL) { | 465 | if (prev == NULL) { |
464 | prom_firstprop(node, p->name); | 466 | name = prom_firstprop(node, NULL); |
465 | } else { | 467 | } else { |
466 | prom_nextprop(node, prev, p->name); | 468 | name = prom_nextprop(node, prev, NULL); |
467 | } | 469 | } |
468 | if (strlen(p->name) == 0) { | 470 | if (strlen(name) == 0) { |
469 | tmp = p; | 471 | tmp = p; |
470 | return NULL; | 472 | return NULL; |
471 | } | 473 | } |
474 | strcpy(p->name, name); | ||
472 | p->length = prom_getproplen(node, p->name); | 475 | p->length = prom_getproplen(node, p->name); |
473 | if (p->length <= 0) { | 476 | if (p->length <= 0) { |
474 | p->length = 0; | 477 | p->length = 0; |