summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2014-01-11 22:03:19 -0500
committerMaarten Lankhorst <[email protected]>2014-01-27 16:40:42 +0100
commit3f264e16e29a870b4b3b605590c718c35bb1a91c (patch)
tree7646b9603f7a27e5c071de7ddafb5b23bd9751c7 /src
parent18d97a8df776863c89c52294055160a17fc0f9e6 (diff)
nv50: don't leak heap on tls alloc failure
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_program.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c
index 73df71c61e2..97857d7989f 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_program.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_program.c
@@ -405,8 +405,10 @@ nv50_program_upload_code(struct nv50_context *nv50, struct nv50_program *prog)
prog->code_base = prog->mem->start;
ret = nv50_tls_realloc(nv50->screen, prog->tls_space);
- if (ret < 0)
+ if (ret < 0) {
+ nouveau_heap_free(&prog->mem);
return FALSE;
+ }
if (ret > 0)
nv50->state.new_tls_space = TRUE;