From: Jean-Jacques Hiblot Date: Mon, 7 Aug 2017 12:07:48 +0200 Subject: [U-Boot] [PATCH v4 3/9] fit: fixed bug in locate_dtb_in_fit() In-Reply-To: <1502100474-26671-1-git-send-email-jjhiblot@ti.com> References: <1502100474-26671-1-git-send-email-jjhiblot@ti.com> Message-ID: <1502100474-26671-4-git-send-email-jjhiblot@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 v3 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; -- 1.9.1