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

Lucas De Marchi lucas.demarchi at intel.com
Thu Apr 10 22:48:30 UTC 2025


Close the dir before returning to avoid leaking the object.

Signed-off-by: Lucas De Marchi <lucas.demarchi 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;
 }
 

-- 
2.49.0



More information about the igt-dev mailing list