kms_atomic_transition: Initialize pipe_crcs to avoid segfault
PATCH 1/1 kms_atomic_transition: Initialize pipe_crcs to avoid segfault
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 <[email protected]>
--- tests/kms_atomic_transition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_atomic_transition.c +1 -1
@@ -608,7 +608,7 @@ static void run_modeset_tests(igt_display_t *display, int howmany, bool nonblockstruct 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;
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Brian Starkey
igt_pipe_crc_new()is skipped for non-Intel devices, but the later calls tocollect_crcs_mask()will attempt to retrieve CRC values if thepipe_crcspointers are non-NULL.Zero-initialise
pipe_crcsto avoid accessing garbage pointers on non-Intel devices.Signed-off-by Brian Starkey <[email protected]>
Reviewed-by Petri Latvala <[email protected]>
Pushed, thanks.
Quoted 24 lines
--- tests/kms_atomic_transition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/kms_atomic_transition.c +1
-1@@ -608,7 +608,7 @@ static void run_modeset_tests(igt_display_t *display, int howmany, bool nonblockstruct 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;Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx