[U-Boot] [PATCH] image-fdt: boot_get_fdt() return value when no DTB exists

Noam Camus noamc at ezchip.com
Wed Oct 22 16:17:49 CEST 2014


From: Noam Camus <noamc at ezchip.com>

I believe that when no DTB is around we should return 1.
This why I fixed such scenarious to not return zero anymore.
Else kernel might get NULL pointer to DTB which doesn't exists.

Signed-off-by: Noam Camus <noamc at ezchip.com>
---
 common/image-fdt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/image-fdt.c b/common/image-fdt.c
index 9fc7481..c142ae6 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -413,11 +413,11 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
 			}
 		} else {
 			debug("## No Flattened Device Tree\n");
-			return 0;
+			goto error;
 		}
 	} else {
 		debug("## No Flattened Device Tree\n");
-		return 0;
+		goto error;
 	}
 
 	*of_flat_tree = fdt_blob;
-- 
1.7.1



More information about the U-Boot mailing list