[Mesa-dev] [PATCH 5/6] si_blit: check zstex nullity

Marek Olšák maraeo at gmail.com
Mon Mar 20 15:33:00 UTC 2017


NAK. zstex can't be NULL here. It's a false coverity defect.

db_depth_clear and db_stencil_clear can be true only if zstex is non-NULL.

Marek

On Thu, Mar 16, 2017 at 3:25 PM, Julien Isorce <julien.isorce at gmail.com> wrote:
> Few lines before there is a if (zstex && zstex->htile_buffer ...)
> which tells that there are some situation where it can be NULL.
>
> So let's check for its nullity in other places too. Spotted by
> coverity:
>
> CID 1237295
>
> Signed-off-by: Julien Isorce <jisorce at oblong.com>
> ---
>  src/gallium/drivers/radeonsi/si_blit.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
> index da6c0cd..db4f533 100644
> --- a/src/gallium/drivers/radeonsi/si_blit.c
> +++ b/src/gallium/drivers/radeonsi/si_blit.c
> @@ -749,14 +749,16 @@ static void si_clear(struct pipe_context *ctx, unsigned buffers,
>         if (sctx->db_depth_clear) {
>                 sctx->db_depth_clear = false;
>                 sctx->db_depth_disable_expclear = false;
> -               zstex->depth_cleared = true;
> +               if (zstex)
> +                       zstex->depth_cleared = true;
>                 si_mark_atom_dirty(sctx, &sctx->db_render_state);
>         }
>
>         if (sctx->db_stencil_clear) {
>                 sctx->db_stencil_clear = false;
>                 sctx->db_stencil_disable_expclear = false;
> -               zstex->stencil_cleared = true;
> +               if (zstex)
> +                       zstex->stencil_cleared = true;
>                 si_mark_atom_dirty(sctx, &sctx->db_render_state);
>         }
>  }
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list