diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2016-02-26 08:46:30 -0800 |
---|---|---|
committer | Matt Roper <matthew.d.roper@intel.com> | 2016-02-26 08:52:53 -0800 |
commit | 3482925454da8c107f720448d24789ce6bf884c4 (patch) | |
tree | 035e196d1c6d8a357e41d7321cb2ae7ede4d3252 | |
parent | 405b3478d1ac28141a334fe42e2908f2ea59e976 (diff) |
kms_atomic: drop unnecessary connector looping from plane_primary test
Local variable num_connectors is never initialized before being
auto-incremented in the loop. If we wind up with a non-zero garbage
value, it will lead us to try to write to an out-of-bounds array index.
We should probably initialize it to zero before use.
However on closer inspection, the plane_primary test doesn't actually
wind up using the connector list or number of connectors, so just remove
the whole block of code; it was probably brought in by accident as part
of a copy-paste operation.
Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
-rw-r--r-- | tests/kms_atomic.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c index c8b8b78a9..2f3080af8 100644 --- a/tests/kms_atomic.c +++ b/tests/kms_atomic.c @@ -909,19 +909,7 @@ static void plane_primary(struct kms_atomic_crtc_state *crtc, struct kms_atomic_plane_state plane = *plane_old; uint32_t format = plane_get_igt_format(&plane); drmModeAtomicReq *req = drmModeAtomicAlloc(); - uint32_t *connectors; - int num_connectors; struct igt_fb fb; - int i; - - connectors = calloc(crtc->state->num_connectors, sizeof(*connectors)); - igt_assert(connectors); - - for (i = 0; i < crtc->state->num_connectors; i++) { - if (crtc->state->connectors[i].crtc_id == crtc->obj) - connectors[num_connectors++] = - crtc->state->connectors[i].obj; - } igt_require(format != 0); |