mirror of https://github.com/xemu-project/xemu.git
ppc/vof: Fix unaligned FDT property access
FDT properties are aligned by 4 bytes, not 8 bytes. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
This commit is contained in:
parent
8af863f2bd
commit
785c8637f9
|
@ -646,7 +646,7 @@ static void vof_dt_memory_available(void *fdt, GArray *claimed, uint64_t base)
|
|||
mem0_reg = fdt_getprop(fdt, offset, "reg", &proplen);
|
||||
g_assert(mem0_reg && proplen == sizeof(uint32_t) * (ac + sc));
|
||||
if (sc == 2) {
|
||||
mem0_end = be64_to_cpu(*(uint64_t *)(mem0_reg + sizeof(uint32_t) * ac));
|
||||
mem0_end = ldq_be_p(mem0_reg + sizeof(uint32_t) * ac);
|
||||
} else {
|
||||
mem0_end = be32_to_cpu(*(uint32_t *)(mem0_reg + sizeof(uint32_t) * ac));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue