From patchwork Sun Nov 28 01:33:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baidu Boy X-Patchwork-Id: 73317 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 D3D8EB70A7 for ; Sun, 28 Nov 2010 12:33:27 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1FBBB2826E; Sun, 28 Nov 2010 02:33:26 +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 cVbXV2BgDP+b; Sun, 28 Nov 2010 02:33:25 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A3E9D28236; Sun, 28 Nov 2010 02:33:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 40E6728236 for ; Sun, 28 Nov 2010 02:33:21 +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 gxl7GpPI3Zsn for ; Sun, 28 Nov 2010 02:33:13 +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 mail-qw0-f44.google.com (mail-qw0-f44.google.com [209.85.216.44]) by theia.denx.de (Postfix) with ESMTP id 0EEA328140 for ; Sun, 28 Nov 2010 02:33:10 +0100 (CET) Received: by qwg5 with SMTP id 5so1915302qwg.3 for ; Sat, 27 Nov 2010 17:33:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.91.73 with SMTP id l9mr3268280qcm.282.1290907989843; Sat, 27 Nov 2010 17:33:09 -0800 (PST) Received: by 10.229.225.12 with HTTP; Sat, 27 Nov 2010 17:33:09 -0800 (PST) Date: Sun, 28 Nov 2010 09:33:09 +0800 Message-ID: From: Baidu Boy To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH V3] bugfix: image header pointer change. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This patch is to avoid potential issue when we still use the pointer images->legacy_hdr_os after the kernel un-compressed. in function boot_get_kernel(): we should let the images->legacy_hdr_os point to the new copied image header, not the original image header in uImage which may be over-written in the kernel un-compressed process. This is a potential problem. Signed-off-by: Baidu Boy --- changes for V2: - Avoid unrelated syntax changes changes for V3: - Add some description for this patch. common/cmd_bootm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) show_boot_progress (6); diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 1a024f1..8f9e5f1 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -896,7 +896,7 @@ static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char * const memmove (&images->legacy_hdr_os_copy, hdr, sizeof(image_header_t)); /* save pointer to image header */ - images->legacy_hdr_os = hdr; + images->legacy_hdr_os = &images->legacy_hdr_os_copy; images->legacy_hdr_valid = 1;