[Mesa-dev] [PATCH 4/4] r600_state: check NULL return from r600_aligned_buffer_create
Marek Olšák
maraeo at gmail.com
Mon Mar 27 15:38:23 UTC 2017
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
BTW, the prefix of all r600 commits should be "r600g:".
Thanks a lot,
Marek
On Fri, Mar 24, 2017 at 12:08 PM, Julien Isorce <julien.isorce at gmail.com> wrote:
> Signed-off-by: Julien Isorce <jisorce at oblong.com>
> ---
> src/gallium/drivers/r600/r600_state.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
> index 6139bd2..9ca113a 100644
> --- a/src/gallium/drivers/r600/r600_state.c
> +++ b/src/gallium/drivers/r600/r600_state.c
> @@ -983,6 +983,11 @@ static void r600_init_color_surface(struct r600_context *rctx,
> PIPE_USAGE_DEFAULT,
> cmask.size, cmask.alignment);
>
> + if (unlikely(!rctx->dummy_cmask)) {
> + surf->color_initialized = false;
> + return;
> + }
> +
> /* Set the contents to 0xCC. */
> ptr = pipe_buffer_map(&rctx->b.b, &rctx->dummy_cmask->b.b, PIPE_TRANSFER_WRITE, &transfer);
> memset(ptr, 0xCC, cmask.size);
> @@ -999,6 +1004,11 @@ static void r600_init_color_surface(struct r600_context *rctx,
> r600_aligned_buffer_create(&rscreen->b.b, 0,
> PIPE_USAGE_DEFAULT,
> fmask.size, fmask.alignment);
> +
> + if (unlikely(!rctx->dummy_fmask)) {
> + surf->color_initialized = false;
> + return;
> + }
> }
> r600_resource_reference(&surf->cb_buffer_fmask, rctx->dummy_fmask);
>
> --
> 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