rbug: Fix rbug_delete_vs_state lock acquisition.
authorVinson Lee <vlee@freedesktop.org>
Sun, 24 May 2020 22:40:39 +0000 (15:40 -0700)
committerMarge Bot <eric+marge@anholt.net>
Sat, 27 Jun 2020 00:21:27 +0000 (00:21 +0000)
Fix warning reported by Coverity Scan.

Double unlock (LOCK)
double_unlock: mtx_unlock unlocks rb_pipe->call_mutex while it is
unlocked.

Fixes: 07838ff990a7 ("rbug: Use the call mutex")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3023
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5196>

src/gallium/auxiliary/driver_rbug/rbug_context.c

index a36f3377e8c2cc357b70bd03aef9fcc58bf6b0df..c391adff244c3f03e56bc606ef0e0b5ef6a1e954 100644 (file)
@@ -490,7 +490,7 @@ rbug_delete_vs_state(struct pipe_context *_pipe,
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct rbug_shader *rb_shader = rbug_shader(_vs);
 
-   mtx_unlock(&rb_pipe->call_mutex);
+   mtx_lock(&rb_pipe->call_mutex);
    rbug_shader_destroy(rb_pipe, rb_shader);
    mtx_unlock(&rb_pipe->call_mutex);
 }