diff options
author | Gabriel Krisman Bertazi <krisman@collabora.co.uk> | 2017-11-15 17:36:58 -0200 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2017-12-04 16:13:55 +0200 |
commit | af4031506aac35d06f5a057f4c96ffd57aeb21e8 (patch) | |
tree | 8005ffe15d63052f878903c4b82be501746cc48e /tests/kms_ccs.c | |
parent | 5763c89080e3abb3955092f895896c9ee408e9e1 (diff) |
tests/kms_ccs: Prevent segfault if pipe is not supported
for_each_plane_on_pipe() indexes bad memory when iterating over an invalid
pipe. Make sure the pipe exists before trying to use it. This prevents
the crash below:
root@ideacentre:~# igt-gpu-tools/tests/kms_ccs --r pipe-D-crc-sprite-planes-basic
IGT-Version: 1.19-g59f0e3d182a8 (x86_64) (Linux: 4.13.0-rc6.intel-boxes+x86_64)
Received signal SIGSEGV.
Stack trace:
#0 [fatal_sig_handler+0x185]
#1 [killpg+0x40]
#2 [__real_main485+0x2de]
#3 [main+0x3f]
#4 [__libc_start_main+0xf1]
#5 [_start+0x2a]
#6 [<unknown>+0x2a]
Subtest pipe-D-crc-sprite-planes-basic: CRASH (0.004s)
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'tests/kms_ccs.c')
-rw-r--r-- | tests/kms_ccs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c index 775c6999..73025a1e 100644 --- a/tests/kms_ccs.c +++ b/tests/kms_ccs.c @@ -503,6 +503,9 @@ igt_main data.flags = TEST_CRC; igt_subtest_f("pipe-%s-crc-sprite-planes-basic", pipe_name) { + + igt_display_require_output_on_pipe(&data.display, data.pipe); + for_each_plane_on_pipe(&data.display, data.pipe, data.plane) { if (data.plane->type == DRM_PLANE_TYPE_PRIMARY) continue; |