venus: Fix leak in syncobj creation failure path
CID: 1475984 Resource leak Signed-off-by: Corentin Noël <corentin.noel@collabora.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35474>
This commit is contained in:
@@ -158,6 +158,8 @@ sim_syncobj_create(struct virtgpu *gpu, bool signaled)
|
||||
sim.syncobjs = _mesa_pointer_hash_table_create(NULL);
|
||||
if (!sim.syncobjs) {
|
||||
mtx_unlock(&sim.mutex);
|
||||
mtx_destroy(&syncobj->mutex);
|
||||
free(syncobj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -172,6 +174,8 @@ sim_syncobj_create(struct virtgpu *gpu, bool signaled)
|
||||
_mesa_hash_table_destroy(sim.syncobjs, NULL);
|
||||
sim.syncobjs = NULL;
|
||||
mtx_unlock(&sim.mutex);
|
||||
mtx_destroy(&syncobj->mutex);
|
||||
free(syncobj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user