radeonsi: fix potential use-after-free of debug callbacks

Found by inspection.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle 2017-10-22 17:38:42 +02:00
parent dd7c273e87
commit b650fc09c3
1 changed files with 4 additions and 0 deletions

View File

@ -158,6 +158,10 @@ static void si_set_debug_callback(struct pipe_context *ctx,
const struct pipe_debug_callback *cb)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_screen *screen = sctx->screen;
util_queue_finish(&screen->shader_compiler_queue);
util_queue_finish(&screen->shader_compiler_queue_low_priority);
if (cb)
sctx->debug = *cb;