mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
winsys/amdgpu: fix memory leaks when amdgpu_cs_create fails
amdgpu_cs_destroy must execute with non-NULL.
This commit is contained in:
parent
1ccb3c79a8
commit
5d2be9792a
1 changed files with 2 additions and 3 deletions
|
|
@ -916,8 +916,7 @@ static void amdgpu_cs_destroy(struct radeon_cmdbuf *rcs)
|
|||
{
|
||||
struct amdgpu_cs *acs = amdgpu_cs(rcs);
|
||||
|
||||
if (!acs)
|
||||
return;
|
||||
assert(acs);
|
||||
|
||||
amdgpu_cs_sync_flush(rcs);
|
||||
util_queue_fence_destroy(&acs->flush_completed);
|
||||
|
|
@ -1018,8 +1017,8 @@ amdgpu_cs_create(struct radeon_cmdbuf *rcs,
|
|||
|
||||
return true;
|
||||
fail:
|
||||
rcs->priv = NULL;
|
||||
amdgpu_cs_destroy(rcs);
|
||||
rcs->priv = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue