From: Jason Ish Date: Tue, 1 Apr 2025 15:31:07 +0000 (-0600) Subject: threads/lib: fix coverity check for unchecked return code X-Git-Tag: suricata-8.0.0-beta1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be111d4d4cd68f920e71d52661ba22ce07679355;p=thirdparty%2Fsuricata.git 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. --- 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);