summaryrefslogtreecommitdiff
path: root/disk/part_efi.c
diff options
context:
space:
mode:
authorMarc Dietrich <marvin24@gmx.de>2013-03-29 07:57:10 +0000
committerTom Rini <trini@ti.com>2013-04-02 16:23:34 -0400
commit8faefadb7305b95d02df38bd2ea61429d59483e5 (patch)
tree1287e43c888dd68f70c933d40973b5a72a0cabfa /disk/part_efi.c
parent795659dc1ce275fcc39d6501affa0c03fd663038 (diff)
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>
Diffstat (limited to 'disk/part_efi.c')
-rw-r--r--disk/part_efi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c
index b3fd0e954d2..e9987f055cb 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -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;
}