On 29/01/18 06:28, Chris Wilson wrote:
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 <ch...@chris-wilson.co.uk>

LGTM.
Reviewed-by: Antonio Argenziano <antonio.argenzi...@intel.com>

---
  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;
  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to