xiaoxiang781216 commented on code in PR #8002:
URL: https://github.com/apache/nuttx/pull/8002#discussion_r1058951402
##########
drivers/note/note_driver.c:
##########
@@ -1210,23 +1217,21 @@ void sched_note_syscall_enter(int nr, int argc, ...)
/* If needed, retrieve the given syscall arguments */
- va_start(ap, argc);
-
args = note.nsc_args;
for (i = 0; i < argc; i++)
{
- arg = (uintptr_t)va_arg(ap, uintptr_t);
+ arg = (uintptr_t)va_arg(copy, uintptr_t);
sched_note_flatten(args, &arg, sizeof(arg));
args += sizeof(uintptr_t);
}
-
- va_end(ap);
}
Review Comment:
need add va_end here
##########
drivers/note/note_driver.c:
##########
@@ -1184,13 +1186,18 @@ void sched_note_syscall_enter(int nr, int argc, ...)
}
#endif
+ va_start(ap, argc);
for (driver = g_note_drivers; *driver; driver++)
{
- if (note_syscall_enter(*driver, nr))
+ va_list copy;
+ va_copy(copy, ap);
+ if (note_syscall_enter(*driver, nr, argc, ©))
{
+ va_end(copy);
continue;
}
+ va_end(copy);
Review Comment:
need move after line 1202
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]