From b0e79d4594e4edd8e9c081e13d70b97bfac8ca22 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 21 Feb 2018 14:22:07 +0100 Subject: tests/kms_chv_cursor_fail: Handle cleanup better. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clean up cursor fb in cleanup_crtc, which means that cursor fb has to be created after prepare_crtc() is called. This will fix a small leak when a subtest fails. Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- tests/kms_chv_cursor_fail.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/kms_chv_cursor_fail.c b/tests/kms_chv_cursor_fail.c index 0dd366c3..7138e549 100644 --- a/tests/kms_chv_cursor_fail.c +++ b/tests/kms_chv_cursor_fail.c @@ -224,6 +224,7 @@ static void cleanup_crtc(data_t *data) data->pipe_crc = NULL; igt_remove_fb(data->drm_fd, &data->primary_fb); + igt_remove_fb(data->drm_fd, &data->fb); } static void prepare_crtc(data_t *data) @@ -262,15 +263,11 @@ static void prepare_crtc(data_t *data) static void test_crtc(data_t *data, unsigned int edges) { - cleanup_crtc(data); + prepare_crtc(data); create_cursor_fb(data, data->curw, data->curh); - prepare_crtc(data); - test_edges(data, edges); - - igt_remove_fb(data->drm_fd, &data->fb); } static int opt_handler(int opt, int opt_index, void *_data) -- cgit v1.2.3