[U-Boot] [PATCH v6 03/10] fit: fixed bug in locate_dtb_in_fit()

Jean-Jacques Hiblot jjhiblot at ti.com
Fri Sep 15 10:57:26 UTC 2017


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 <jjhiblot at ti.com>
Reviewed-by: Tom Rini <trini at konsulko.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
 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 ce42931..add65c4 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



More information about the U-Boot mailing list