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>
This commit is contained in:
xypron.glpk@gmx.de 2017-07-30 21:40:37 +02:00 committed by Tom Rini
parent 2d5e86b110
commit 36d35345b1

View file

@ -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;
}