[Mesa-dev] [PATCH] llvmpipe: Remove unnecessary null check of shader.
Brian Paul
brianp at vmware.com
Mon Sep 30 07:34:30 PDT 2013
On 09/27/2013 10:30 PM, Vinson Lee wrote:
> 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 at freedesktop.org>
> ---
> src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
> index 875a3cf..8223d2a 100644
> --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
> +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
> @@ -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 {
>
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list