From 7004548bdf28f47fcc0d2fc1c96457f1a15bc4f1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 9 Nov 2020 18:02:21 -0800 Subject: [PATCH] turnip: Remove pipeline NULL check. pipeline cannot be NULL since pipeline->layout->num_sets was just checked. Fix defect reported by Coverity Scan. Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking pipeline suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 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 19f22cdf0a7..5b6ba00e710 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -68,7 +68,7 @@ tu6_load_state_size(struct tu_pipeline *pipeline, bool compute) const unsigned load_state_size = 4; unsigned size = 0; for (unsigned i = 0; i < pipeline->layout->num_sets; i++) { - if (pipeline && !(pipeline->active_desc_sets & (1u << i))) + if (!(pipeline->active_desc_sets & (1u << i))) continue; struct tu_descriptor_set_layout *set_layout = pipeline->layout->set[i].layout;