diff --git a/xen/common/device-tree/kernel.c b/xen/common/device-tree/kernel.c index ef393182b6..28096121a5 100644 --- a/xen/common/device-tree/kernel.c +++ b/xen/common/device-tree/kernel.c @@ -18,7 +18,11 @@ static uint32_t __init output_length(char *image, unsigned long image_len) { - return *(uint32_t *)&image[image_len - 4]; + uint32_t val; + + memcpy(&val, &image[image_len - 4], sizeof(val)); + + return val; } int __init kernel_decompress(struct boot_module *mod, uint32_t offset)