intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH i-g-t v2 1/5] lib/igt_kms: Fix drm_plane leak
@ 2017-02-20 11:02 Brian Starkey
  2017-02-20 11:02 ` [PATCH i-g-t v2 2/5] lib/igt_kms: Neaten up pipe->planes[] assignment Brian Starkey
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Brian Starkey @ 2017-02-20 11:02 UTC (permalink / raw)
  To: intel-gfx

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>
---
 lib/igt_kms.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d6b7d677ed8d..9e59e35f2e2f 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);
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-02-21 10:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-20 11:02 [PATCH i-g-t v2 1/5] lib/igt_kms: Fix drm_plane leak Brian Starkey
2017-02-20 11:02 ` [PATCH i-g-t v2 2/5] lib/igt_kms: Neaten up pipe->planes[] assignment Brian Starkey
2017-02-20 11:02 ` [PATCH i-g-t v2 3/5] lib/igt_kms: Fix possible out-of-bounds access Brian Starkey
2017-02-20 11:02 ` [PATCH i-g-t v2 4/5] lib/igt_kms: Fix memory corruption when there's no cursor plane Brian Starkey
2017-02-20 11:02 ` [PATCH i-g-t v2 5/5] lib/igt_kms: Remove redundant cursor code Brian Starkey
2017-02-21 10:12 ` [PATCH i-g-t v2 1/5] lib/igt_kms: Fix drm_plane leak Brian Starkey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).