summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_shader.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2018-10-09 08:55:46 -0600
committerBrian Paul <brianp@vmware.com>2018-10-09 11:17:14 -0600
commit797e34f65879039aecc0a677c44af0a1185edfd7 (patch)
treeab83b7f7559a43e7adb04cfa9ddccbaaec5a8f80 /src/gallium/drivers/svga/svga_shader.c
parentb781688636a42be2120047b868abc9bab823acbf (diff)
svga: change svga_destroy_shader_variant() to return void
svga_destroy_shader_variant() itself flushes and retries the command if there's a failure. So no need for the callers to do it. Other callers of the function were already ignoring the return value. This also fixes a corner-case double-free reported by Coverity (and reported by Dave Airlie). Tested with various OpenGL apps. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_shader.c')
-rw-r--r--src/gallium/drivers/svga/svga_shader.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_shader.c b/src/gallium/drivers/svga/svga_shader.c
index 7a0bb3db447..22e449835d5 100644
--- a/src/gallium/drivers/svga/svga_shader.c
+++ b/src/gallium/drivers/svga/svga_shader.c
@@ -541,7 +541,7 @@ svga_new_shader_variant(struct svga_context *svga)
}
-enum pipe_error
+void
svga_destroy_shader_variant(struct svga_context *svga,
SVGA3dShaderType type,
struct svga_shader_variant *variant)
@@ -557,6 +557,7 @@ svga_destroy_shader_variant(struct svga_context *svga,
/* flush and try again */
svga_context_flush(svga, NULL);
ret = SVGA3D_vgpu10_DestroyShader(svga->swc, variant->id);
+ assert(ret == PIPE_OK);
}
util_bitmask_clear(svga->shader_id_bm, variant->id);
}
@@ -583,8 +584,6 @@ svga_destroy_shader_variant(struct svga_context *svga,
FREE(variant);
svga->hud.num_shaders--;
-
- return ret;
}
/*