From b650fc09c3a35ca624aad5fe4b5c34867708f116 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 22 Oct 2017 17:38:42 +0200 Subject: [PATCH] radeonsi: fix potential use-after-free of debug callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Found by inspection. Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_pipe.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.30.2