Skip to contentSkip to conversation

disk: fix unaligned access in efi partitions

PATCH New Marc Dietrich 2 participants 2 messages Mar 29, 2013 – Apr 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
V2: replace le32_to_cpu(get_unaligned()) with get_unaligned_le32

 disk/part_efi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
disk/part_efi.c +2 -1
index b3fd0e9..e9987f0 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/1 disk: fix unaligned access in efi partitions

Quoted 4 lines · Marc Dietrich

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130403/dd866dce/attachment.pgp>