]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
threads/lib: fix coverity check for unchecked return code
authorJason Ish <jason.ish@oisf.net>
Tue, 1 Apr 2025 15:31:07 +0000 (09:31 -0600)
committerVictor Julien <victor@inliniac.net>
Tue, 1 Apr 2025 19:11:13 +0000 (21:11 +0200)
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

index 19aa6eff3d5b3b5aff8ce1e27ae7f70920315190..63222f99702195b2ee7bdaec3dbdcaa234c26db1 100644 (file)
@@ -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);