]> git.sur5r.net Git - u-boot/blobdiff - lib/tpm.c
tools/file2include: create Linux style SPDX header
[u-boot] / lib / tpm.c
index d21bbcfb11d2183bb7d83a51064c99805eab9e36..bc9652d8e4eeecc7dcc85bfc941e4efdd5919716 100644 (file)
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2013 The Chromium OS Authors.
  * Coypright (c) 2013 Guntermann & Drunck GmbH
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -92,6 +91,7 @@ int pack_byte_string(uint8_t *str, size_t size, const char *format, ...)
                        break;
                default:
                        debug("Couldn't recognize format string\n");
+                       va_end(args);
                        return -1;
                }
 
@@ -170,8 +170,10 @@ int unpack_byte_string(const uint8_t *str, size_t size, const char *format, ...)
                        return -1;
                }
 
-               if (offset + length > size)
+               if (offset + length > size) {
+                       va_end(args);
                        return -1;
+               }
 
                switch (*format) {
                case 'b':