]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
disk: fix unaligned access in efi partitions
authorMarc Dietrich <marvin24@gmx.de>
Fri, 29 Mar 2013 07:57:10 +0000 (07:57 +0000)
committerTom Rini <trini@ti.com>
Tue, 2 Apr 2013 20:23:34 +0000 (16:23 -0400)
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>
disk/part_efi.c

index b3fd0e954d27316d0bee726a2f0c2905b01b11e5..e9987f055cb1c123c5df1c361db20ca38b538dd3 100644 (file)
@@ -30,6 +30,7 @@
  *
  * This limits the maximum size of addressable storage to < 2 Terra Bytes
  */
+#include <asm/unaligned.h>
 #include <common.h>
 #include <command.h>
 #include <ide.h>
@@ -505,7 +506,7 @@ err:
 static int pmbr_part_valid(struct partition *part)
 {
        if (part->sys_ind == EFI_PMBR_OSTYPE_EFI_GPT &&
-               le32_to_cpu(part->start_sect) == 1UL) {
+               get_unaligned_le32(&part->start_sect) == 1UL) {
                return 1;
        }