From: Marek Olšák Date: Wed, 24 May 2017 16:16:41 +0000 (+0200) Subject: util: slab_destroy_child should check whether it's been initialized X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c70b0604f0296080333d6dd86940782559bd4a5b;p=mesa.git util: slab_destroy_child should check whether it's been initialized Reviewed-by: Samuel Pitoiset Reviewed-by: Nicolai Hähnle --- diff --git a/src/util/slab.c b/src/util/slab.c index 4264814cabc..4ce0e9a3485 100644 --- a/src/util/slab.c +++ b/src/util/slab.c @@ -140,6 +140,9 @@ void slab_create_child(struct slab_child_pool *pool, */ void slab_destroy_child(struct slab_child_pool *pool) { + if (!pool->parent) + return; /* the slab probably wasn't even created */ + mtx_lock(&pool->parent->mutex); while (pool->pages) {