[PATCH] selftests/net: Add missing va_end in test_snprintf

Liu Jing posted 1 patch 1 month, 1 week ago
tools/testing/selftests/net/tcp_ao/lib/aolib.h | 1 +
1 file changed, 1 insertion(+)
[PATCH] selftests/net: Add missing va_end in test_snprintf
Posted by Liu Jing 1 month, 1 week ago
There is no va_end after va_copy, just add it.

Signed-off-by: Liu Jing <liujing_yewu@cmss.chinamobile.com>
Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
---
 tools/testing/selftests/net/tcp_ao/lib/aolib.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/net/tcp_ao/lib/aolib.h b/tools/testing/selftests/net/tcp_ao/lib/aolib.h
index db44e77428dd..5db2f65cddc4 100644
--- a/tools/testing/selftests/net/tcp_ao/lib/aolib.h
+++ b/tools/testing/selftests/net/tcp_ao/lib/aolib.h
@@ -46,6 +46,7 @@ static inline char *test_snprintf(const char *fmt, va_list vargs)
 
 	va_copy(tmp, vargs);
 	n = vsnprintf(ret, size, fmt, tmp);
+	va_end(tmp);
 	if (n < 0)
 		return NULL;
 
-- 
2.27.0
Re: [PATCH] selftests/net: Add missing va_end in test_snprintf
Posted by Simon Horman 1 month, 1 week ago
On Thu, Oct 17, 2024 at 03:52:51PM +0800, Liu Jing wrote:
> There is no va_end after va_copy, just add it.
> 
> Signed-off-by: Liu Jing <liujing_yewu@cmss.chinamobile.com>
> Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>

Thanks,

This is correct. However, it was fixed recently in the same way
by the following commit authored by one of your colleagues, Zhang Jiao:

- 7c2f1c2690a5 ("selftests/net: Add missing va_end.")
  https://git.kernel.org/netdev/net-next/c/7c2f1c2690a5

-- 
pw-bot: not-applicable