From 2341397eb752209bc22c519d583d9ea8a31e7245 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 6 May 2021 12:19:27 +0100 Subject: [PATCH] raw/ioat: fix directory handle leak When reading the /dev directory as part of the bus scan for DSA devices, the directory handle from opendir was not freed on function return, leading to a resource leak. Coverity issue: 370588 Fixes: b7aaf417f936 ("raw/ioat: add bus driver for device scanning automatically") Signed-off-by: Bruce Richardson --- drivers/raw/ioat/idxd_bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/raw/ioat/idxd_bus.c b/drivers/raw/ioat/idxd_bus.c index 5b448d49de..5199786785 100644 --- a/drivers/raw/ioat/idxd_bus.c +++ b/drivers/raw/ioat/idxd_bus.c @@ -312,6 +312,7 @@ dsa_scan(void) dev->device.numa_node = numa_node; } + closedir(dev_dir); return 0; } -- 2.20.1