[Intel-gfx] [PATCH i-g-t] kms_atomic_transition: Initialize pipe_crcs to avoid segfault

Petri Latvala petri.latvala at intel.com
Mon Feb 20 10:48:47 UTC 2017


On Fri, Feb 17, 2017 at 03:26:54PM +0000, Brian Starkey wrote:
> igt_pipe_crc_new() is skipped for non-Intel devices, but the later calls
> to collect_crcs_mask() will attempt to retrieve CRC values if the
> pipe_crcs pointers are non-NULL.
> 
> Zero-initialise pipe_crcs to avoid accessing garbage pointers on
> non-Intel devices.
> 
> Signed-off-by: Brian Starkey <brian.starkey at arm.com>

Reviewed-by: Petri Latvala <petri.latvala at intel.com>

Pushed, thanks.




> ---
>  tests/kms_atomic_transition.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
> index ba8c8b5ca02b..1599f0b36c4e 100644
> --- a/tests/kms_atomic_transition.c
> +++ b/tests/kms_atomic_transition.c
> @@ -608,7 +608,7 @@ static void run_modeset_tests(igt_display_t *display, int howmany, bool nonblock
>  	struct igt_fb fbs[2];
>  	int i, j;
>  	unsigned iter_max = 1 << display->n_pipes;
> -	igt_pipe_crc_t *pipe_crcs[I915_MAX_PIPES];
> +	igt_pipe_crc_t *pipe_crcs[I915_MAX_PIPES] = { 0 };
>  	igt_output_t *output;
>  	unsigned width = 0, height = 0;
>  	bool skip_test = false;
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list