[igt-dev] [PATCH i-g-t 3/3] igt/kms_addfb_basic: Add missing calls to gem_close

Deepak Rawat drawat at vmware.com
Wed Jan 16 00:22:30 UTC 2019


Few gem_close calls were missing add them.

Signed-off-by: Deepak Rawat <drawat at vmware.com>
---
 tests/kms_addfb_basic.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
index 9c4c2c4d..dd948ca8 100644
--- a/tests/kms_addfb_basic.c
+++ b/tests/kms_addfb_basic.c
@@ -372,9 +372,11 @@ static void tiling_tests(int fd)
 			if (is_dumb) {
 				kmstest_dumb_destroy(fd, tiled_x_bo);
 				kmstest_dumb_destroy(fd, tiled_y_bo);
+				kmstest_dumb_destroy(fd, gem_bo);
 			} else {
 				gem_close(fd, tiled_x_bo);
 				gem_close(fd, tiled_y_bo);
+				gem_close(fd, gem_bo);
 			}
 		}
 	}
@@ -651,6 +653,7 @@ static void prop_tests(int fd)
 	struct drm_mode_obj_get_properties get_props = {};
 	struct drm_mode_obj_set_property set_prop = {};
 	uint64_t prop, prop_val;
+	bool is_dumb = false;
 
 	f.width = 1024;
 	f.height = 1024;
@@ -659,7 +662,7 @@ static void prop_tests(int fd)
 
 	igt_fixture {
 		gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024,
-			DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL);
+			DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, &is_dumb);
 		igt_assert(gem_bo);
 
 		f.handles[0] = gem_bo;
@@ -704,8 +707,14 @@ static void prop_tests(int fd)
 				    &set_prop) == -1 && errno == EINVAL);
 	}
 
-	igt_fixture
+	igt_fixture {
 		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0);
+		if (is_dumb) {
+			kmstest_dumb_destroy(fd, gem_bo);
+		} else {
+			gem_close(fd, gem_bo);
+		}
+	}
 
 }
 
-- 
2.17.1



More information about the igt-dev mailing list