From 098a4013434dafda61fa47bde08c29b36f436e9b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 29 Jan 2018 14:26:24 +0000 Subject: igt/prime_mmap_coherency: Close dmabuf after use 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 Reviewed-by: Antonio Argenziano --- tests/prime_mmap_coherency.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/prime_mmap_coherency.c') diff --git a/tests/prime_mmap_coherency.c b/tests/prime_mmap_coherency.c index 192b4348..04b15ddd 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; } -- cgit v1.2.3