summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrian Starkey <brian.starkey@arm.com>2017-02-20 11:02:44 +0000
committerRobert Foss <robert.foss@collabora.com>2017-02-21 10:02:15 -0500
commit4cb80dbd18f182250eec62b52b79f3abf01ce815 (patch)
tree537cdda5d2714456c76f9a39ce88ab31f709cdde /lib
parent4a9259230847d9756ab964205d350dfb8dcf508b (diff)
lib/igt_kms: Fix drm_plane leak
In the loop looking for planes on a pipe, we always want to free up the drm_plane afterwards. Fixes: 36656239ef96 lib/igt_kms: Implement dynamic plane count support Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Robert Foss <robert.foss@collabora.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d6b7d677..9e59e35f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1613,12 +1613,10 @@ void igt_display_init(igt_display_t *display, int drm_fd)
plane_resources->planes[j]);
igt_assert(drm_plane);
- if (!(drm_plane->possible_crtcs & (1 << i))) {
- drmModeFreePlane(drm_plane);
- continue;
- }
+ if (drm_plane->possible_crtcs & (1 << i))
+ n_planes++;
- n_planes++;
+ drmModeFreePlane(drm_plane);
}
igt_assert_lte(0, n_planes);