From patchwork Fri Mar 29 11:28:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Dietrich X-Patchwork-Id: 232374 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 BFF102C00C4 for ; Fri, 29 Mar 2013 22:29:40 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2EF1C4A026; Fri, 29 Mar 2013 12:29:38 +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 Yii4R-Hqxm9q; Fri, 29 Mar 2013 12:29:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9F0D74A027; Fri, 29 Mar 2013 12:29:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 06A5D4A027 for ; Fri, 29 Mar 2013 12:29:20 +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 ANSVaBkC8ZxL for ; Fri, 29 Mar 2013 12:29:12 +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.15.15]) by theia.denx.de (Postfix) with ESMTP id 9C1BC4A026 for ; Fri, 29 Mar 2013 12:29:09 +0100 (CET) Received: from mailout-de.gmx.net ([10.1.76.16]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0MKfbV-1UKiPc3L7P-0021u8 for ; Fri, 29 Mar 2013 12:29:07 +0100 Received: (qmail invoked by alias); 29 Mar 2013 11:29:07 -0000 Received: from pD9E5D5F2.dip0.t-ipconnect.de (EHLO ax5200p.fritz.box) [217.229.213.242] by mail.gmx.net (mp016) with SMTP; 29 Mar 2013 12:29:07 +0100 X-Authenticated: #9962044 X-Provags-ID: V01U2FsdGVkX19BRydD/lRBf9A+bnrdPPi19aBd7sbR1/UZhdgBFq Dd9wcHw0y3JzdB From: Marc Dietrich To: U-Boot@lists.denx.de Date: Fri, 29 Mar 2013 12:28:58 +0100 Message-Id: <6ff0548717babcbc52d225394549106e659cc303.1364556523.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] 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 macro. Signed-off-by: Marc Dietrich --- 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 #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) { + le32_to_cpu(get_unaligned(&part->start_sect)) == 1UL) { return 1; }