Mesa (master): util: slab_destroy_child should check whether it' s been initialized

Marek Olšák mareko at kemper.freedesktop.org
Sun May 28 23:52:42 UTC 2017


Module: Mesa
Branch: master
Commit: c70b0604f0296080333d6dd86940782559bd4a5b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c70b0604f0296080333d6dd86940782559bd4a5b

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed May 24 18:16:41 2017 +0200

util: slab_destroy_child should check whether it's been initialized

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/util/slab.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/slab.c b/src/util/slab.c
index 4264814cab..4ce0e9a348 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) {




More information about the mesa-commit mailing list