[igt-dev] [PATCH igt] igt/prime_mmap_coherency: Close dmabuf after use

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 29 14:28:28 UTC 2018


As we loop over the coherency tests many times, we need to close the
dmabufs opened on every pass to prevent a fd leak and the test
exploding when it hits the process limit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103649
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/prime_mmap_coherency.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/prime_mmap_coherency.c b/tests/prime_mmap_coherency.c
index 192b43489..04b15dddb 100644
--- a/tests/prime_mmap_coherency.c
+++ b/tests/prime_mmap_coherency.c
@@ -101,6 +101,8 @@ static int test_read_flush(void)
 	drm_intel_bo_unreference(bo_1);
 	munmap(ptr_cpu, width * height);
 
+	close(dma_buf_fd);
+
 	return stale;
 }
 
@@ -169,6 +171,9 @@ static int test_write_flush(void)
 	drm_intel_bo_unreference(bo_2);
 	munmap(ptr_cpu, width * height);
 
+	close(dma_buf2_fd);
+	close(dma_buf_fd);
+
 	return stale;
 }
 
-- 
2.15.1



More information about the igt-dev mailing list