From patchwork Fri Mar 29 17:57:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Dietrich X-Patchwork-Id: 232471 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id A79382C00BC for ; Sat, 30 Mar 2013 04:58:17 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 426F74A026; Fri, 29 Mar 2013 18:58:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8z4rxoJiHMAn; Fri, 29 Mar 2013 18:58:15 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ECF334A027; Fri, 29 Mar 2013 18:58:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1311A4A027 for ; Fri, 29 Mar 2013 18:58:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xPItJ5DYv9Rz for ; Fri, 29 Mar 2013 18:58:11 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by theia.denx.de (Postfix) with ESMTP id 5B7804A026 for ; Fri, 29 Mar 2013 18:58:09 +0100 (CET) Received: from mailout-de.gmx.net ([10.1.76.32]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0Mg20J-1TyAtR3nuP-00NRnB for ; Fri, 29 Mar 2013 18:58:09 +0100 Received: (qmail invoked by alias); 29 Mar 2013 17:58:08 -0000 Received: from pD9E5D5F2.dip0.t-ipconnect.de (EHLO ax5200p.fritz.box) [217.229.213.242] by mail.gmx.net (mp032) with SMTP; 29 Mar 2013 18:58:08 +0100 X-Authenticated: #9962044 X-Provags-ID: V01U2FsdGVkX19vJ/Uez9dvx4adJ7Ue7/paWB782qio/cfSY8GTBv SlsKjU+8hn2kGF From: Marc Dietrich To: U-Boot@lists.denx.de Date: Fri, 29 Mar 2013 18:57:10 +0100 Message-Id: <93f22fdc6befbb84cf7ff9519dea43c7a0ccec3d.1364579605.git.marvin24@gmx.de> X-Mailer: git-send-email 1.7.9.5 X-Y-GMX-Trusted: 0 Cc: twarren.nvidia@gmail.com Subject: [U-Boot] [PATCH V2] disk: fix unaligned access in efi partitions X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- V2: replace le32_to_cpu(get_unaligned()) with get_unaligned_le32 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..e9987f0 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 #include #include #include @@ -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; }