[PATCH master 5/6] memory_display: don't skip va_end in error case

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jun 12 05:53:30 PDT 2023


There's a va_start at the start of __pr_memory_display, but va_end was
only called in the successful case. Fix this.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/memory_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/memory_display.c b/common/memory_display.c
index 77868be26ace..c0ca469703d3 100644
--- a/common/memory_display.c
+++ b/common/memory_display.c
@@ -123,9 +123,9 @@ int __pr_memory_display(int level, const void *addr, loff_t offs, unsigned nbyte
 
 	} while (nbytes > 0);
 
-	va_end(args);
 	ret = 0;
 out:
+	va_end(args);
 
 	return ret;
 }
-- 
2.39.2




More information about the barebox mailing list