summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_pipe_fs.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_pipe_fs.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_pipe_fs.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_fs.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_fs.c b/src/gallium/drivers/svga/svga_pipe_fs.c
index aadfb1a54e1..52366f0f216 100644
--- a/src/gallium/drivers/svga/svga_pipe_fs.c
+++ b/src/gallium/drivers/svga/svga_pipe_fs.c
@@ -108,12 +108,7 @@ svga_delete_fs_state(struct pipe_context *pipe, void *shader)
svga->state.hw_draw.fs = NULL;
}
- ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_PS, variant);
- if (ret != PIPE_OK) {
- svga_context_flush(svga, NULL);
- ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_PS, variant);
- assert(ret == PIPE_OK);
- }
+ svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_PS, variant);
}
FREE((void *)fs->base.tokens);