[U-Boot] [PATCH 1/1] relocate-rela: add missing va_end()

Heinrich Schuchardt xypron.glpk at gmx.de
Wed May 3 20:40:11 UTC 2017


va_start must always be matched by va_end.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 tools/relocate-rela.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c
index 3c9d134ac2..df968eb5fd 100644
--- a/tools/relocate-rela.c
+++ b/tools/relocate-rela.c
@@ -27,9 +27,11 @@ static void debug(const char *fmt, ...)
 {
 	va_list args;
 
-	va_start(args, fmt);
-	if (debug_en)
+	if (debug_en) {
+		va_start(args, fmt);
 		vprintf(fmt, args);
+		va_end(args);
+	}
 }
 
 static bool supported_rela(Elf64_Rela *rela)
-- 
2.11.0



More information about the U-Boot mailing list