Mesa (staging/20.1): rbug: Fix rbug_delete_vs_state lock acquisition.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jun 27 20:28:06 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: c2f7f6a78b9900b9f2d8f54653c324d8b8390c9f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2f7f6a78b9900b9f2d8f54653c324d8b8390c9f

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Sun May 24 15:40:39 2020 -0700

rbug: Fix rbug_delete_vs_state lock acquisition.

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 at freedesktop.org>
Reviewed-by: Jakob Bornecrantz <jakob at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5196>
(cherry picked from commit c0c03f4772fef361137bba5681b71215aca107d1)

---

 .pick_status.json                                | 2 +-
 src/gallium/auxiliary/driver_rbug/rbug_context.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 975d5f0e8a2..a4f677cc7a3 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4,7 +4,7 @@
         "description": "rbug: Fix rbug_delete_vs_state lock acquisition.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "07838ff990a74e3acd95de7042042b49ecc51570"
     },
diff --git a/src/gallium/auxiliary/driver_rbug/rbug_context.c b/src/gallium/auxiliary/driver_rbug/rbug_context.c
index a36f3377e8c..c391adff244 100644
--- a/src/gallium/auxiliary/driver_rbug/rbug_context.c
+++ b/src/gallium/auxiliary/driver_rbug/rbug_context.c
@@ -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);
 }



More information about the mesa-commit mailing list