From 571a8dab618635bde58cd0bf2092a94f3b9dedfe Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Fri, 8 Dec 2023 08:24:58 +0100 Subject: [PATCH] rem: fix coverity defect in destructor --- rem/aumix/aumix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rem/aumix/aumix.c b/rem/aumix/aumix.c index e034f3f2b..e7f0ced50 100644 --- a/rem/aumix/aumix.c +++ b/rem/aumix/aumix.c @@ -62,7 +62,11 @@ static void destructor(void *arg) { struct aumix *mix = arg; - if (mix->run) { + mtx_lock(&mix->mutex); + bool run = mix->run; + mtx_unlock(&mix->mutex); + + if (run) { mtx_lock(&mix->mutex); mix->run = false;