summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernie Thompson <bhthompson@chromium.org>2012-01-17 13:58:16 -0800
committerGerrit <chrome-bot@google.com>2012-01-19 09:57:27 -0800
commit885a9774ef469666854a0e4bed7c33733d0396c7 (patch)
tree4ddfd7a1cf192a28ecfffbab93d69b2a7f235d76
parent25381875e1b8e230a7bbfe59470d796826056319 (diff)
downloadvboot-885a9774ef469666854a0e4bed7c33733d0396c7.tar.gz
Add a failure check to ReadFdtBlock in ReadFdtPlatformFamily
This adds in logic to check that ReadFdtBlock within ReadFdtPlatformFamily succeeded, returning NULL on failure. BUG=None TEST=Manual, run crossystem on an ARM system without a valid compatible FDT entry and ensure (error) is returned for platform_family. Change-Id: I6351292ff73e4bc08b028f85e72ccfe62159194a Reviewed-on: https://gerrit.chromium.org/gerrit/14321 Reviewed-by: Olof Johansson <olofj@chromium.org> Reviewed-by: Bernie Thompson <bhthompson@chromium.org> Tested-by: Bernie Thompson <bhthompson@chromium.org> Commit-Ready: Bernie Thompson <bhthompson@chromium.org>
-rw-r--r--host/arch/arm/lib/crossystem_arch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c
index 62cf31f6..305fddf3 100644
--- a/host/arch/arm/lib/crossystem_arch.c
+++ b/host/arch/arm/lib/crossystem_arch.c
@@ -165,7 +165,8 @@ static char * ReadFdtPlatformFamily(void) {
size_t size = 0;
int slen;
- ReadFdtBlock(FDT_COMPATIBLE_PATH, &compat, &size);
+ if(ReadFdtBlock(FDT_COMPATIBLE_PATH, &compat, &size))
+ return NULL;
if (size > 0)
compat[size-1] = 0;