[Mesa-stable] [Mesa-dev] [PATCH] gallium/radeon: handle failure when mapping staging buffer

Marek Olšák maraeo at gmail.com
Wed Apr 13 17:24:38 UTC 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Wed, Apr 13, 2016 at 6:22 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Cc: "11.1 11.2" <mesa-stable at lists.freedesktop.org>
> ---
>  src/gallium/drivers/radeon/r600_buffer_common.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
> index 47514e9..664dc5b 100644
> --- a/src/gallium/drivers/radeon/r600_buffer_common.c
> +++ b/src/gallium/drivers/radeon/r600_buffer_common.c
> @@ -376,6 +376,10 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
>                                        0, 0, resource, level, box);
>
>                         data = r600_buffer_map_sync_with_rings(rctx, staging, PIPE_TRANSFER_READ);
> +                       if (!data) {
> +                               pipe_resource_reference((struct pipe_resource **)&staging, NULL);
> +                               return NULL;
> +                       }
>                         data += box->x % R600_MAP_BUFFER_ALIGNMENT;
>
>                         return r600_buffer_get_transfer(ctx, resource, level, usage, box,
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-stable mailing list