diff mbox series

[25/25] contrib/plugins: fix coverity warning in hotblocks

Message ID 20231009164104.369749-26-alex.bennee@linaro.org
State Superseded
Headers show
Series October maintainer omnibus pre-PR (tests, gdbstub, plugins) | expand

Commit Message

Alex Bennée Oct. 9, 2023, 4:41 p.m. UTC
Coverity complains that we have an unbalance use of mutex leading to
potential deadlocks.

Fixes: CID 1519048
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 contrib/plugins/hotblocks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Oct. 10, 2023, noon UTC | #1
On 9/10/23 18:41, Alex Bennée wrote:
> Coverity complains that we have an unbalance use of mutex leading to
> potential deadlocks.
> 
> Fixes: CID 1519048

Fixes: a208ba09bd ("tests/plugin: add a hotblocks plugin")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   contrib/plugins/hotblocks.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c
index 6b74d25fea..4de1b13494 100644
--- a/contrib/plugins/hotblocks.c
+++ b/contrib/plugins/hotblocks.c
@@ -69,8 +69,8 @@  static void plugin_exit(qemu_plugin_id_t id, void *p)
         }
 
         g_list_free(it);
-        g_mutex_unlock(&lock);
     }
+    g_mutex_unlock(&lock);
 
     qemu_plugin_outs(report->str);
 }