diff options
author | Rob Clark <[email protected]> | 2015-06-26 13:38:03 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2015-06-30 12:13:44 -0400 |
commit | 0a8c8fa770db4cc4ef3db89a5dae1d136361495d (patch) | |
tree | a2feedda845a4dda818fdcecb5b545e1cd71e979 /src/gallium/drivers/freedreno/ir3 | |
parent | 1370fde8af1b0b5c5e6204c0dea6ebffb85dce0a (diff) |
freedreno/ir3: fix crash in fail path
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_shader.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.c b/src/gallium/drivers/freedreno/ir3/ir3_shader.c index b5b038100cc..c22b7f8d169 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.c @@ -46,7 +46,8 @@ delete_variant(struct ir3_shader_variant *v) { if (v->ir) ir3_destroy(v->ir); - fd_bo_del(v->bo); + if (v->bo) + fd_bo_del(v->bo); free(v); } @@ -228,8 +229,10 @@ ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key) /* compile new variant if it doesn't exist already: */ v = create_variant(shader, key); - v->next = shader->variants; - shader->variants = v; + if (v) { + v->next = shader->variants; + shader->variants = v; + } return v; } |