From patchwork Wed Oct 24 04:04:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 193663 X-Patchwork-Delegate: sjg@chromium.org 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 15AF52C0080 for ; Wed, 24 Oct 2012 15:07:19 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC65B4A4CC; Wed, 24 Oct 2012 06:06:52 +0200 (CEST) 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 lwBlYRTd0DQH; Wed, 24 Oct 2012 06:06:52 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 32A234A4CE; Wed, 24 Oct 2012 06:05:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 631014A1A8 for ; Wed, 24 Oct 2012 06:05:21 +0200 (CEST) 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 tGpHekCxzjb0 for ; Wed, 24 Oct 2012 06:05:20 +0200 (CEST) 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-gh0-f202.google.com (mail-gh0-f202.google.com [209.85.160.202]) by theia.denx.de (Postfix) with ESMTPS id 2AF184A450 for ; Wed, 24 Oct 2012 06:05:07 +0200 (CEST) Received: by mail-gh0-f202.google.com with SMTP id z15so9146ghb.3 for ; Tue, 23 Oct 2012 21:05:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=YzI7cpfke6+c4NPclRWnV9fqUJWNktP96MrEeIZUm0Q=; b=V/enhC9M0srDjFWRDnqwPFH8/3xG0JgFRqbvVs1LYuO/PBuaJmlvCe+mky1OgYfnTy BmFf69PkZQBP2uHVhoQNQgJyjzA2uoMpH2UOEV+Fc8OzcUxMHSTPg47/cJY+WvLmL958 cyjGw5yLU79OPwGmg/TIMH/2EyULzCGGaGZ1winy11iFgBxmBng4kbCk1dNPp+PF1Cvy XdQFru27cDfi2QhHdPdemETJIS71ohvjnDknGQDVrDHEll1ttzwhI8iz35qgWeSqLFX9 E3SatiyVl99zugwkDS7esioSa/CHGTsD7d1WIeSTfHTT9smzrwEKL8+HQ31u9ccektqG s6bQ== Received: by 10.236.89.114 with SMTP id b78mr10025556yhf.16.1351051506449; Tue, 23 Oct 2012 21:05:06 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id m9si1222741yhc.5.2012.10.23.21.05.06 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 23 Oct 2012 21:05:06 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 4A0DA100047; Tue, 23 Oct 2012 21:05:06 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 28F411623F3; Tue, 23 Oct 2012 21:05:06 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 23 Oct 2012 21:04:43 -0700 Message-Id: <1351051486-6980-13-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1351051486-6980-1-git-send-email-sjg@chromium.org> References: <1351051486-6980-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQmdyw0Jbw2LYAf1IZc5CftvRrtwice8/6cOGJOgncTA/KIEKEHusreR/+RIj7W1wkVXWSHfvHVWpHuGIS+P+Fiw88XS5X/avJLK4PlHBy7RLEJ7Mk2qFS5R13prO+K/DWj0OcqZ4jTwGV8Y1PkgpgX9P/cIctCC4oyu6iuoXcwWVUKaBNlbbEw6u/0ZAjcHT/gsERPa Cc: Duncan Laurie Subject: [U-Boot] [PATCH 12/15] x86: Fix off-by-one error in do_elf_reloc_fixups() 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 From: Duncan Laurie The use of post-increment with a do-while loop results in the loop going one step too far when handling relocation fixups. In about 1/100 cases this would cause it to hang. Signed-off-by: Duncan Laurie Signed-off-by: Simon Glass --- arch/x86/lib/relocate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index 200baab..c0b9b29 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -85,7 +85,7 @@ int do_elf_reloc_fixups(void) *offset_ptr_ram += gd->reloc_off; } } - } while (re_src++ < re_end); + } while (++re_src < re_end); return 0; }