mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 03:50:13 +01:00
gallium/u_slab: fix possible crash in util_slab_destroy
It may happen if util_slab_create has not been called. Reviewed-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
6a94c9dde0
commit
99d5c1a13b
1 changed files with 5 additions and 3 deletions
|
|
@ -160,9 +160,11 @@ void util_slab_destroy(struct util_slab_mempool *pool)
|
|||
{
|
||||
struct util_slab_page *page, *temp;
|
||||
|
||||
foreach_s(page, temp, &pool->list) {
|
||||
remove_from_list(page);
|
||||
FREE(page);
|
||||
if (pool->list.next) {
|
||||
foreach_s(page, temp, &pool->list) {
|
||||
remove_from_list(page);
|
||||
FREE(page);
|
||||
}
|
||||
}
|
||||
|
||||
pipe_mutex_destroy(pool->mutex);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue