From be111d4d4cd68f920e71d52661ba22ce07679355 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Tue, 1 Apr 2025 09:31:07 -0600 Subject: [PATCH] threads/lib: fix coverity check for unchecked return code In thread startup, return error of TmThreadsWaitForUnpause() fails. Fixed coverity check as in all other places the return value of this function is checked and acted on. --- src/tm-threads.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tm-threads.c b/src/tm-threads.c index 19aa6eff3d..63222f9970 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -396,13 +396,15 @@ static void *TmThreadsLib(void *td) goto error; } - TmThreadsWaitForUnpause(tv); + if (!TmThreadsWaitForUnpause(tv)) { + goto error; + } return NULL; error: tv->stream_pq = NULL; - return NULL; + return (void *)-1; } static void *TmThreadsSlotVar(void *td) @@ -1751,7 +1753,9 @@ TmEcode TmThreadLibSpawn(ThreadVars *tv) return TM_ECODE_FAILED; } - tv->tm_func((void *)tv); + if (tv->tm_func((void *)tv) == (void *)-1) { + return TM_ECODE_FAILED; + } TmThreadWaitForFlag(tv, THV_INIT_DONE | THV_RUNNING_DONE); -- 2.47.2