From 0a8c8fa770db4cc4ef3db89a5dae1d136361495d Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 26 Jun 2015 13:38:03 -0400 Subject: freedreno/ir3: fix crash in fail path Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3_shader.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/freedreno/ir3') 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; } -- cgit v1.2.3