From b1df00cb7943c9869b1542c97ebb4eac81c0040c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 16 Jun 2022 15:42:29 -0700 Subject: [PATCH] tu: Check dereferenced value of rop_reads_dst. Fix defect reported by Coverity Scan. Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking rop_reads_dst suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Fixes: 94be0dd0b86 ("tu: Implement extendedDynamicState2LogicOp") Signed-off-by: Vinson Lee Part-of: --- src/freedreno/vulkan/tu_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index 6e5a797f3c5..815ce4d4206 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -2212,7 +2212,7 @@ tu6_emit_rb_mrt_controls(struct tu_pipeline *pipeline, if (att->blendEnable) pipeline->blend_enable |= BIT(i); - if (att->blendEnable || rop_reads_dst) { + if (att->blendEnable || *rop_reads_dst) { total_bpp += write_bpp; } }