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

Antonio Argenziano antonio.argenziano at intel.com
Tue Jan 30 00:48:59 UTC 2018



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 <chris at chris-wilson.co.uk>

LGTM.
Reviewed-by: Antonio Argenziano <antonio.argenziano at 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;
>   }
>   
> 


More information about the igt-dev mailing list