[PATCH i-g-t] kms_debugfs: Add missing free()

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed Jul 23 16:51:27 UTC 2025


Hi Peter,
On 2025-07-23 at 12:15:19 +0200, Peter Senna Tschudin wrote:

subject could be improved:

[PATCH i-g-t] tests/kms_debugfs: Add missing free()

> Commit ebe65a923a2b ("tests: Add kms_debugfs") introduced a new test.
> Unfortunately that commit missed a call to free(display) during the
> cleanup.
> 
> Fixes: ebe65a923a2b ("tests: Add kms_debugfs")
> Cc: Karthik B S <karthik.b.s at intel.com>
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> Signed-off-by: Peter Senna Tschudin <peter.senna at linux.intel.com>
> ---
>  tests/kms_debugfs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/kms_debugfs.c b/tests/kms_debugfs.c
> index 75ef15353..25134e941 100644
> --- a/tests/kms_debugfs.c
> +++ b/tests/kms_debugfs.c
> @@ -129,6 +129,7 @@ igt_main
>  
>  	igt_fixture {
>  		igt_display_fini(display);
> +		free(display);

Or use static var like in all other kms tests?
Cause you could end up with no display allocated,
so it should be:

		if (display) {
	  		igt_display_fini(display);
			free(display);
		}

Regards,
Kamil

>  		close(debugfs);
>  		drm_close_driver(fd);
>  	}
> -- 
> 2.43.0
> 


More information about the igt-dev mailing list