[igt-dev] [PATCH i-g-t 2/4] i915/kms_mmap_write_crc: Free the mmap and dma-buf fd

Swati Sharma swati2.sharma at intel.com
Fri Jun 9 13:20:17 UTC 2023


From: Chris Wilson <chris.p.wilson at intel.com>

Release the dma-buf fd (held also by the mmap) after testing so that we
can check for kernel resource leaks atexit.

Signed-off-by: Chris Wilson <chris.p.wilson at intel.com>
Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>
---
 tests/i915/kms_mmap_write_crc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/i915/kms_mmap_write_crc.c b/tests/i915/kms_mmap_write_crc.c
index bc51975f..87f51153 100644
--- a/tests/i915/kms_mmap_write_crc.c
+++ b/tests/i915/kms_mmap_write_crc.c
@@ -165,6 +165,9 @@ static void test(data_t *data)
 	/* check that the crc is as expected, which requires that caches got flushed */
 	igt_pipe_crc_collect_crc(data->pipe_crc, &crc);
 	igt_assert_crc_equal(&crc, &data->ref_crc);
+
+	munmap(ptr, fb->size);
+	close(dma_buf_fd);
 }
 
 static void prepare_crtc(data_t *data)
-- 
2.25.1



More information about the igt-dev mailing list