vulkan/wsi/wayland: Fix use after free
In7eaceb0392I called pthread_mutex_unlock() with a member of a freed structure. We can unlock as soon as this element is removed from the list it was in, so just move the unlock to before the free. Fixes7eaceb0392Signed-off-by: Derek Foreman <derek.foreman@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28432>
This commit is contained in:
@@ -1929,8 +1929,8 @@ wsi_wl_presentation_update_present_id(struct wsi_wl_present_id *id)
|
||||
id->chain->present_ids.max_completed = id->present_id;
|
||||
|
||||
wl_list_remove(&id->link);
|
||||
vk_free(id->alloc, id);
|
||||
pthread_mutex_unlock(&id->chain->present_ids.lock);
|
||||
vk_free(id->alloc, id);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user