[PATCH i-g-t 01/10] lib/igt_kmod: Fix leaking dir

Riana Tauro riana.tauro at intel.com
Fri Apr 11 07:26:20 UTC 2025



On 4/11/2025 4:18 AM, Lucas De Marchi wrote:
> Close the dir before returning to avoid leaking the object.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
Reviewed-by: Riana Tauro <riana.tauro at intel.com>> ---
>   lib/igt_kmod.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index 2cf2e7894..4e1a3d42d 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -690,6 +690,8 @@ int igt_kmod_unbind(const char *mod_name, const char *pci_device)
>   		close(devfd);
>   	}
>   
> +	closedir(dir);
> +
>   	return 0;
>   }
>   
> 



More information about the igt-dev mailing list