util: thread: Use wait_for_completion without result
authorSung-hun Kim <sfoon.kim@samsung.com>
Tue, 9 Aug 2022 02:01:48 +0000 (11:01 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 10 Aug 2022 09:27:03 +0000 (18:27 +0900)
Change-Id: I3969491c2ce9d8ecccfdb064bc65274cb05cb53f
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
src/util/thread.c

index 8bcef56..0bf45ec 100644 (file)
@@ -196,7 +196,8 @@ int wait_for_completion(struct thread *thread, void **result)
        if (ret == THREAD_RETURN_ERROR)
                return ret;
 
-       *result = ctx->result;
+       if (result)
+               *result = ctx->result;
 
        cnd_destroy(&ctx->wait);
        mtx_destroy(&ctx->lock);