From: Nicolai Hähnle Date: Sun, 22 Oct 2017 15:38:42 +0000 (+0200) Subject: radeonsi: fix potential use-after-free of debug callbacks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b650fc09c3a35ca624aad5fe4b5c34867708f116;p=mesa.git radeonsi: fix potential use-after-free of debug callbacks Found by inspection. Reviewed-by: Marek Olšák --- diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 7940fc8d5b2..7c50ffae6a3 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -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;