Skip to content

Commit

Permalink
dzn: Fix qpool->queries_lock double lock
Browse files Browse the repository at this point in the history
Fix defect reported by Coverity Scan.

Double lock (LOCK)
double_lock: mtx_lock locks qpool->queries_lock while it is locked.

Fixes: a012b21 ("microsoft: Initial vulkan-on-12 driver")
Signed-off-by: Vinson Lee <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23455>
(cherry picked from commit ed759ad)
  • Loading branch information
vinsonlee authored and 1ace committed Jun 7, 2023
1 parent 8c92afe commit 17a0c96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pick_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@
"description": "dzn: Fix qpool->queries_lock double lock",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "a012b219640e875aa552b37dfdaf69336d5863c7"
},
Expand Down
2 changes: 1 addition & 1 deletion src/microsoft/vulkan/dzn_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ dzn_ResetQueryPool(VkDevice device,
query->fence = NULL;
}
}
mtx_lock(&qpool->queries_lock);
mtx_unlock(&qpool->queries_lock);

memset((uint8_t *)qpool->collect_map + dzn_query_pool_get_result_offset(qpool, firstQuery),
0, queryCount * qpool->query_size);
Expand Down

0 comments on commit 17a0c96

Please sign in to comment.