diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-11-19 08:31:05 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-11-19 13:41:30 +0000 |
commit | 55500abe99273049b0650f1a0d81a4f20f34da3b (patch) | |
tree | bd2e08b033f4693fa7bb13dc0de7a57f0acb125f /lib/igt_kms.c | |
parent | a0014d7d6849924fe8d7c7e82f42a61d823e7066 (diff) |
lib/kms: Range check pipe before lookup
Make sure the lookup index is within the range of the table before
accessing.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r-- | lib/igt_kms.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index e5d8e82c..9175e50f 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1902,7 +1902,7 @@ static void igt_fill_display_format_mod(igt_display_t *display); */ void igt_require_pipe(igt_display_t *display, enum pipe pipe) { - igt_skip_on_f(!display->pipes[pipe].enabled, + igt_skip_on_f(pipe >= display->n_pipes || !display->pipes[pipe].enabled, "Pipe %s does not exist or not enabled\n", kmstest_pipe_name(pipe)); } |