mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 10:14:13 +08:00
tu/kgsl: Fix memory leak of tmp allocations during submissions
cc: mesa-stable
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12805>
(cherry picked from commit 3ccd199708
)
This commit is contained in:
parent
15524986b8
commit
9fa7e28179
@ -310,7 +310,7 @@
|
||||
"description": "tu/kgsl: Fix memory leak of tmp allocations during submissions",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
@ -1120,8 +1120,7 @@ kgsl_queue_submit(struct tu_queue *queue, struct vk_queue_submit *vk_submit)
|
||||
if (ret) {
|
||||
result = vk_device_set_lost(&queue->device->vk, "submit failed: %s\n",
|
||||
strerror(errno));
|
||||
pthread_mutex_unlock(&queue->device->submit_mutex);
|
||||
return result;
|
||||
goto fail_submit;
|
||||
}
|
||||
|
||||
queue->last_submit_timestamp = req.timestamp;
|
||||
@ -1140,6 +1139,21 @@ kgsl_queue_submit(struct tu_queue *queue, struct vk_queue_submit *vk_submit)
|
||||
pthread_mutex_unlock(&queue->device->submit_mutex);
|
||||
pthread_cond_broadcast(&queue->device->timeline_cond);
|
||||
|
||||
if (cmd_buffers != (struct tu_cmd_buffer **) vk_submit->command_buffers)
|
||||
vk_free(&queue->device->vk.alloc, cmd_buffers);
|
||||
|
||||
vk_free(&queue->device->vk.alloc, cmds);
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
||||
fail_submit:
|
||||
pthread_mutex_unlock(&queue->device->submit_mutex);
|
||||
|
||||
if (cmd_buffers != (struct tu_cmd_buffer **) vk_submit->command_buffers)
|
||||
vk_free(&queue->device->vk.alloc, cmd_buffers);
|
||||
|
||||
vk_free(&queue->device->vk.alloc, cmds);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user