summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-04-30 22:31:26 -0400
committerIlia Mirkin <[email protected]>2016-05-01 11:19:08 -0400
commit3950aa47df26ad4cbfa9ca02dffa8ebd5a9b432a (patch)
treedb948f156f7541e7f19adba7aa43004293d82bee /src/gallium/drivers/softpipe
parentad545d179bf56312d9d655a0a672af3732e43365 (diff)
softpipe: avoid leaking local_mem on machines alloc failure
Spotted by Coverity Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Vinson Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_compute.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_compute.c b/src/gallium/drivers/softpipe/sp_compute.c
index d5b5913f6a2..53f7a0beb77 100644
--- a/src/gallium/drivers/softpipe/sp_compute.c
+++ b/src/gallium/drivers/softpipe/sp_compute.c
@@ -191,8 +191,10 @@ softpipe_launch_grid(struct pipe_context *context,
}
machines = CALLOC(sizeof(struct tgsi_exec_machine *), num_threads_in_group);
- if (!machines)
+ if (!machines) {
+ FREE(local_mem);
return;
+ }
/* initialise machines + GRID_SIZE + THREAD_ID + BLOCK_SIZE */
for (d = 0; d < bdepth; d++) {