[Mesa-dev] [PATCH] gallium/radeon: Initialize pipe_resource::next to NULL
Nicolai Hähnle
nhaehnle at gmail.com
Tue Sep 27 10:04:54 UTC 2016
Ouch :)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
On 27.09.2016 11:18, Michel Dänzer 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;
>
More information about the mesa-dev
mailing list