[5/5] thread_with_file: Fix missing va_end()

Message ID 170873669481.1861696.7555634432474446443.stgit@frogsfrogsfrogs
State New
Headers
Series [1/5] thread_with_file: allow creation of readonly files |

Commit Message

Darrick J. Wong Feb. 24, 2024, 1:17 a.m. UTC
  From: Kent Overstreet <kent.overstreet@linux.dev>

Fixes: https://lore.kernel.org/linux-bcachefs/202402131603.E953E2CF@keescook/T/#u
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 lib/thread_with_file.c |    2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/lib/thread_with_file.c b/lib/thread_with_file.c
index 8b129744a48a3..37a1ea22823ca 100644
--- a/lib/thread_with_file.c
+++ b/lib/thread_with_file.c
@@ -118,6 +118,8 @@  static ssize_t darray_vprintf(darray_char *out, gfp_t gfp, const char *fmt, va_l
 
 		va_copy(args2, args);
 		len = vsnprintf(out->data + out->nr, darray_room(*out), fmt, args2);
+		va_end(args2);
+
 		if (len + 1 <= darray_room(*out)) {
 			out->nr += len;
 			return len;