nv50: don't leak heap on tls alloc failure

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Ilia Mirkin 2014-01-11 22:03:19 -05:00 committed by Maarten Lankhorst
parent 18d97a8df7
commit 3f264e16e2
1 changed files with 3 additions and 1 deletions

View File

@ -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;