[Mesa-dev] [PATCH] gallium/radeon: Initialize pipe_resource::next to NULL

Marek Olšák maraeo at gmail.com
Tue Sep 27 12:36:17 UTC 2016


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

Marek

On Tue, Sep 27, 2016 at 11:18 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Fixes lots of piglit tests crashing due to using uninitialized memory.
>
> Fixes: ecd6fce2611e ("mesa/st: support lowering multi-planar YUV")
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>  src/gallium/drivers/radeon/r600_buffer_common.c | 1 +
>  src/gallium/drivers/radeon/r600_texture.c       | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
> index 2e8b6f4..cbbcc29 100644
> --- a/src/gallium/drivers/radeon/r600_buffer_common.c
> +++ b/src/gallium/drivers/radeon/r600_buffer_common.c
> @@ -511,6 +511,7 @@ r600_alloc_buffer_struct(struct pipe_screen *screen,
>         rbuffer = MALLOC_STRUCT(r600_resource);
>
>         rbuffer->b.b = *templ;
> +       rbuffer->b.b.next = NULL;
>         pipe_reference_init(&rbuffer->b.b.reference, 1);
>         rbuffer->b.b.screen = screen;
>         rbuffer->b.vtbl = &r600_buffer_vtbl;
> diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
> index b02b2dc..71564e2 100644
> --- a/src/gallium/drivers/radeon/r600_texture.c
> +++ b/src/gallium/drivers/radeon/r600_texture.c
> @@ -1040,6 +1040,7 @@ r600_texture_create_object(struct pipe_screen *screen,
>
>         resource = &rtex->resource;
>         resource->b.b = *base;
> +       resource->b.b.next = NULL;
>         resource->b.vtbl = &r600_texture_vtbl;
>         pipe_reference_init(&resource->b.b.reference, 1);
>         resource->b.b.screen = screen;
> --
> 2.9.3
>
> _______________________________________________
> 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