aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/nvram_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/nvram_64.c')
-rw-r--r--arch/powerpc/kernel/nvram_64.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 8213ee1eb05a..fd82c289ab1c 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -223,9 +223,13 @@ static int __init nvram_write_header(struct nvram_partition * part)
223{ 223{
224 loff_t tmp_index; 224 loff_t tmp_index;
225 int rc; 225 int rc;
226 226 struct nvram_header phead;
227
228 memcpy(&phead, &part->header, NVRAM_HEADER_LEN);
229 phead.length = cpu_to_be16(phead.length);
230
227 tmp_index = part->index; 231 tmp_index = part->index;
228 rc = ppc_md.nvram_write((char *)&part->header, NVRAM_HEADER_LEN, &tmp_index); 232 rc = ppc_md.nvram_write((char *)&phead, NVRAM_HEADER_LEN, &tmp_index);
229 233
230 return rc; 234 return rc;
231} 235}
@@ -505,6 +509,8 @@ int __init nvram_scan_partitions(void)
505 509
506 memcpy(&phead, header, NVRAM_HEADER_LEN); 510 memcpy(&phead, header, NVRAM_HEADER_LEN);
507 511
512 phead.length = be16_to_cpu(phead.length);
513
508 err = 0; 514 err = 0;
509 c_sum = nvram_checksum(&phead); 515 c_sum = nvram_checksum(&phead);
510 if (c_sum != phead.checksum) { 516 if (c_sum != phead.checksum) {