From cc9166274a617790413d34326e966b9d0edfda7a Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 30 Dec 2022 11:46:06 +0800 Subject: [PATCH] drivers/note: Fix the mismatch of va_end call Signed-off-by: Xiang Xiao --- drivers/note/note_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c index 88d4a5a298..44571e7865 100644 --- a/drivers/note/note_driver.c +++ b/drivers/note/note_driver.c @@ -1195,6 +1195,7 @@ void sched_note_syscall_enter(int nr, int argc, ...) for (driver = g_note_drivers; *driver; driver++) { va_list copy; + va_copy(copy, ap); if (note_syscall_enter(*driver, nr, argc, ©)) { @@ -1202,9 +1203,9 @@ void sched_note_syscall_enter(int nr, int argc, ...) continue; } - va_end(copy); if ((*driver)->ops->add == NULL) { + va_end(copy); continue; } @@ -1231,6 +1232,8 @@ void sched_note_syscall_enter(int nr, int argc, ...) } } + va_end(copy); + /* Add the note to circular buffer */ note_add(*driver, ¬e, length);