From 836c1c6fb10e308d353aa2ff50f239545c2daa27 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 3 Feb 2021 14:11:44 -0500 Subject: [PATCH] pan/bi: Fix NULL deref with empty shader Fixes regression in dEQP-GLES31.functional.compute.basic.empty Fixes: d0902aa2d4d ("pan/bi: Pass through wait_{6, 7} flags") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 4177949076d..f54e1224ebe 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2406,7 +2406,7 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir, pan_block *first_block = list_first_entry(&ctx->blocks, pan_block, link); bi_clause *first_clause = bi_next_clause(ctx, first_block, NULL); - unsigned first_deps = first_clause->dependencies; + unsigned first_deps = first_clause ? first_clause->dependencies : 0; program->wait_6 = (first_deps & (1 << 6)); program->wait_7 = (first_deps & (1 << 7));