Mesa (master): turnip: Remove pipeline NULL check.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 10 02:22:34 UTC 2020


Module: Mesa
Branch: master
Commit: 7004548bdf28f47fcc0d2fc1c96457f1a15bc4f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7004548bdf28f47fcc0d2fc1c96457f1a15bc4f1

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Mon Nov  9 18:02:21 2020 -0800

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 <vlee at freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7521>

---

 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;



More information about the mesa-commit mailing list