llvmpipe: Fix leak of CS local memory with 0 threads.
authorEmma Anholt <emma@anholt.net>
Fri, 3 Sep 2021 20:28:58 +0000 (13:28 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Sep 2021 19:16:32 +0000 (19:16 +0000)
Fixes: bde08ce4d7bf ("llvmpipe: handle compute shader launch with 0 threads")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12724>

src/gallium/drivers/llvmpipe/lp_cs_tpool.c

index ea28446..dd28dba 100644 (file)
@@ -121,6 +121,7 @@ lp_cs_tpool_queue_task(struct lp_cs_tpool *pool,
       for (unsigned t = 0; t < num_iters; t++) {
          work(data, t, &lmem);
       }
+      FREE(lmem.local_mem_ptr);
       return NULL;
    }
    task = CALLOC_STRUCT(lp_cs_tpool_task);