Commit 8faefadb7305b95d02df38bd2ea61429d59483e5
Committed by
Tom Rini
1 parent
795659dc1c
Exists in
master
and in
53 other branches
disk: fix unaligned access in efi partitions
start_sect is not aligned to a 4 byte boundary thus causing exceptions on ARM platforms. Access this field via the get_unaligned_le32 macro. Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
disk/part_efi.c
... | ... | @@ -30,6 +30,7 @@ |
30 | 30 | * |
31 | 31 | * This limits the maximum size of addressable storage to < 2 Terra Bytes |
32 | 32 | */ |
33 | +#include <asm/unaligned.h> | |
33 | 34 | #include <common.h> |
34 | 35 | #include <command.h> |
35 | 36 | #include <ide.h> |
... | ... | @@ -505,7 +506,7 @@ |
505 | 506 | static int pmbr_part_valid(struct partition *part) |
506 | 507 | { |
507 | 508 | if (part->sys_ind == EFI_PMBR_OSTYPE_EFI_GPT && |
508 | - le32_to_cpu(part->start_sect) == 1UL) { | |
509 | + get_unaligned_le32(&part->start_sect) == 1UL) { | |
509 | 510 | return 1; |
510 | 511 | } |
511 | 512 |