diff options
-rw-r--r-- | arch/powerpc/kernel/nvram_64.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index b8a50fa5875b..bb12b3248f13 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -42,6 +42,7 @@ struct nvram_header { | |||
42 | unsigned char signature; | 42 | unsigned char signature; |
43 | unsigned char checksum; | 43 | unsigned char checksum; |
44 | unsigned short length; | 44 | unsigned short length; |
45 | /* Terminating null required only for names < 12 chars. */ | ||
45 | char name[12]; | 46 | char name[12]; |
46 | }; | 47 | }; |
47 | 48 | ||
@@ -201,7 +202,7 @@ static void __init nvram_print_partitions(char * label) | |||
201 | printk(KERN_WARNING "--------%s---------\n", label); | 202 | printk(KERN_WARNING "--------%s---------\n", label); |
202 | printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n"); | 203 | printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n"); |
203 | list_for_each_entry(tmp_part, &nvram_partitions, partition) { | 204 | list_for_each_entry(tmp_part, &nvram_partitions, partition) { |
204 | printk(KERN_WARNING "%4d \t%02x\t%02x\t%d\t%s\n", | 205 | printk(KERN_WARNING "%4d \t%02x\t%02x\t%d\t%12s\n", |
205 | tmp_part->index, tmp_part->header.signature, | 206 | tmp_part->index, tmp_part->header.signature, |
206 | tmp_part->header.checksum, tmp_part->header.length, | 207 | tmp_part->header.checksum, tmp_part->header.length, |
207 | tmp_part->header.name); | 208 | tmp_part->header.name); |
@@ -256,7 +257,7 @@ int __init nvram_remove_partition(const char *name, int sig) | |||
256 | 257 | ||
257 | /* Make partition a free partition */ | 258 | /* Make partition a free partition */ |
258 | part->header.signature = NVRAM_SIG_FREE; | 259 | part->header.signature = NVRAM_SIG_FREE; |
259 | sprintf(part->header.name, "wwwwwwwwwwww"); | 260 | strncpy(part->header.name, "wwwwwwwwwwww", 12); |
260 | part->header.checksum = nvram_checksum(&part->header); | 261 | part->header.checksum = nvram_checksum(&part->header); |
261 | rc = nvram_write_header(part); | 262 | rc = nvram_write_header(part); |
262 | if (rc <= 0) { | 263 | if (rc <= 0) { |