From patchwork Fri Aug 4 17:00:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 797925 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="O/SFH2kL"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xPCx80M7dz9sxR for ; Sat, 5 Aug 2017 03:05:47 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CFEECC21EBA; Fri, 4 Aug 2017 17:02:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id DB626C21E27; Fri, 4 Aug 2017 17:01:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E7F02C21E9B; Fri, 4 Aug 2017 17:01:24 +0000 (UTC) Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by lists.denx.de (Postfix) with ESMTPS id C4EA2C21C26 for ; Fri, 4 Aug 2017 17:01:17 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v74H1DQk020565; Fri, 4 Aug 2017 12:01:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1501866073; bh=6gRevhl61KwvPF+WwQmhcSpFKoqB8x8Z8YF8o6Xyeq8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=O/SFH2kLL/eyT3wsH+i8yfb4Qj3InpUwLUnopXSqM8ASiI8k/GkJH+pJ2Ro3He7tZ hOzY2N20rz6/SCXgdhZwnGn5Wsl9FvTBPXU672tKBUZH4Bvix5ms77BTnSe8DQv4kw P5gMMvYzl8FLSVI3+6EMurIc3Rw7vfHKsPUi4Mow= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v74H1DNL018726; Fri, 4 Aug 2017 12:01:13 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Fri, 4 Aug 2017 12:01:12 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v74H1CTh032319; Fri, 4 Aug 2017 12:01:12 -0500 From: Jean-Jacques Hiblot To: , , , Date: Fri, 4 Aug 2017 19:00:58 +0200 Message-ID: <1501866064-7853-4-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501866064-7853-1-git-send-email-jjhiblot@ti.com> References: <1501866064-7853-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 3/9] fit: fixed bug in locate_dtb_in_fit() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If the dtb is the first data of the FIT, the its offset is 0x0. Change the test to '<' instead of '<=' Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Tom Rini Reviewed-by: Simon Glass --- no change since v2 common/boot_fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/boot_fit.c b/common/boot_fit.c index 3767c63..8e81745 100644 --- a/common/boot_fit.c +++ b/common/boot_fit.c @@ -73,7 +73,7 @@ void *locate_dtb_in_fit(const void *fit) ret = fdt_offset(fit); - if (ret <= 0) + if (ret < 0) return NULL; else return (void *)fit+size+ret;