Enable static analysis in presubmit.

clang-check is now available in the clang toolchain prebuilts so can be
used in presubmit.

One fix was needed as the analysis proved that an unhandled error led to
an invalid pointer dereference.

Change-Id: I59213df883462f4f4a723b44297a8fe0f79cad41
diff --git a/kokoro/ubuntu/build.sh b/kokoro/ubuntu/build.sh
index f15971a..45f5d51 100755
--- a/kokoro/ubuntu/build.sh
+++ b/kokoro/ubuntu/build.sh
@@ -30,7 +30,7 @@
 # TODO: add a gcc-4.9 or above prebuilt to check the gcc build too?
 # Check the build works.
 make
-#TODO: static analysis with make check
+make check
 
 #
 # Step 2: make sure it works.
diff --git a/src/fdt.c b/src/fdt.c
index 599fca4..d7d1aad 100644
--- a/src/fdt.c
+++ b/src/fdt.c
@@ -322,7 +322,10 @@
 	struct fdt_node node;
 
 	/* Traverse the whole thing. */
-	fdt_root_node(&node, hdr);
+	if (!fdt_root_node(&node, hdr)) {
+		dlog("FDT failed validation.\n");
+		return;
+	}
 
 	fdt_tokenizer_init(&t, node.strs, node.begin, node.end);