public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] disk: fix unaligned access in efi partitions
@ 2013-03-29 11:28 Marc Dietrich
  2013-03-29 12:32 ` Albert ARIBAUD
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Dietrich @ 2013-03-29 11:28 UTC (permalink / raw)
  To: u-boot

start_sect is not aligned to a 4 byte boundary thus causing exceptions
on ARM platforms. Access this field via the get_unaligned macro.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
---
 disk/part_efi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index b3fd0e9..6678a4c 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) {
+		le32_to_cpu(get_unaligned(&part->start_sect)) == 1UL) {
 		return 1;
 	}
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-29 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-29 11:28 [U-Boot] [PATCH] disk: fix unaligned access in efi partitions Marc Dietrich
2013-03-29 12:32 ` Albert ARIBAUD
2013-03-29 15:13   ` Marc Dietrich
2013-03-29 15:57     ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox