Re: [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane

Kahola, Mika
2019-01-16T11:30:25Z

On Wed, 2019-01-16 at 13:20 +0200, Petri Latvala wrote:

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Mika Kahola <mika.kahola@intel.com>
> Cc: Robert Foss <robert.foss@collabora.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> lib/igt_kms.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index b06acb2b..1a91791c 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1593,6 +1593,7 @@ static void kmstest_get_crtc(int device, enum
> pipe pipe, struct kmstest_crtc *cr
>
> n = ftell(file);
> crtc->n_planes = parse_planes(file,
> NULL);
> + igt_assert_lt(0, crtc->n_planes);
> crtc->planes = calloc(crtc->n_planes,
> sizeof(*crtc->planes));
> igt_assert_f(crtc->planes, "Failed to
> allocate memory for %d planes\n", crtc->n_planes);
>