validate.py: Fixed condition for checking metadata

When the YAML file is invalid there is no point in checking metadata.
The condition was updated and metadata is only checked on valid YAML
files.

Change-Id: I12c110f0353b03f46bc7e4b0c943caca8463a6b7
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
diff --git a/validate.py b/validate.py
index cc117df..54edb75 100755
--- a/validate.py
+++ b/validate.py
@@ -153,8 +153,10 @@
 def validate_file(args, path):
     exitcode = 0
     if path.endswith(".yaml"):
-        exitcode = exitcode + validate_yaml(path, args)
-        exitcode = exitcode + metadata_check(path, args)
+        exitcode = validate_yaml(path, args)
+        if exitcode == 0:
+            # if yaml isn't valid there is no point in checking metadata
+            exitcode = metadata_check(path, args)
     elif run_pep8 and path.endswith(".py"):
         exitcode = pep8_check(path, args)
     elif path.endswith(".php"):