summaryrefslogtreecommitdiff
path: root/lib/tpm.c
diff options
context:
space:
mode:
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>2017-07-30 19:40:37 (GMT)
committerTom Rini <trini@konsulko.com>2017-08-13 19:17:29 (GMT)
commit36d35345b1f6124d7e1763c818ec29e1709f9eec (patch)
tree7310eb198cfa77c87542a26cdc120d199ba0347b /lib/tpm.c
parent2d5e86b110e7287beba0627c41dab795e8d17aea (diff)
downloadu-boot-fsl-qoriq-36d35345b1f6124d7e1763c818ec29e1709f9eec.tar.xz
tpm: add missing va_end
va_start must always be matched by va_end. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/tpm.c')
-rw-r--r--lib/tpm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tpm.c b/lib/tpm.c
index fb520e3..d1cf5a8 100644
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -95,8 +95,10 @@ int pack_byte_string(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':
@@ -163,6 +165,7 @@ int unpack_byte_string(const uint8_t *str, size_t size, const char *format, ...)
length = va_arg(args, uint32_t);
break;
default:
+ va_end(args);
debug("Couldn't recognize format string\n");
return -1;
}