From 613e9e9c23dfaf1964fe7bba33458ee98e802a6e Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 25 Jun 2025 11:38:21 +0200 Subject: [PATCH] radeonsi: check set_debug_callback before use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The callback might not be installed yet if si_create_context fails early. Fixes: 59a3f38ff6f ("radeonsi: clear the debug callback on ctx destroy") Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_pipe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 53d6c893ea8..9bce4b2724f 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -193,7 +193,8 @@ static void si_destroy_context(struct pipe_context *context) { struct si_context *sctx = (struct si_context *)context; - context->set_debug_callback(context, NULL); + if (context->set_debug_callback) + context->set_debug_callback(context, NULL); util_unreference_framebuffer_state(&sctx->framebuffer.state); util_framebuffer_init(context, NULL, sctx->framebuffer.fb_cbufs, &sctx->framebuffer.fb_zsbuf);