Skip to contentSkip to conversation

raw/ioat: fix resource leak for directory handle

PATCH Applied Bruce Richardson 2 participants 2 messages May 6, 2021 – May 10, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raw/ioat: fix resource leak for directory handle

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")
---
 drivers/raw/ioat/idxd_bus.c | 1 +
 1 file changed, 1 insertion(+)
drivers/raw/ioat/idxd_bus.c +1 -0
index 5b448d49de..5199786785 100644
@@ -312,6 +312,7 @@ dsa_scan(void)
 		dev->device.numa_node = numa_node;
 	}
 
+	closedir(dev_dir);
 	return 0;
 }
 
Signature · 1 line
2.30.2
#1 lore raw

06/05/2021 13:19, Bruce Richardson:

Quoted 8 lines

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")

Applied, thanks