llvmpipe: Remove unnecessary null check of shader.
authorVinson Lee <vlee@freedesktop.org>
Sat, 28 Sep 2013 04:27:19 +0000 (21:27 -0700)
committerVinson Lee <vlee@freedesktop.org>
Tue, 1 Oct 2013 05:00:54 +0000 (22:00 -0700)
shader has already been dereferenced earlier so cannot be null here.

Fixes "Dereference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/llvmpipe/lp_state_fs.c

index 875a3cf11a1f0771080cc9113d9a7027774a69b0..8223d2ad7eb69d22d2aaa173f2bc019ffc781024 100644 (file)
@@ -2435,7 +2435,7 @@ generate_variant(struct llvmpipe_context *lp,
          !shader->info.base.uses_kill
       ? TRUE : FALSE;
 
-   if ((!shader || shader->info.base.num_tokens <= 1) &&
+   if ((shader->info.base.num_tokens <= 1) &&
        !key->depth.enabled && !key->stencil[0].enabled) {
       variant->ps_inv_multiplier = 0;
    } else {