The sysfs_get_enabled() opened file processor not closed,
may cause a file handle leak.
Signed-off-by: Hao Zeng <zenghao@xxxxxxxxxx>
---
tools/power/cpupower/lib/powercap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/power/cpupower/lib/powercap.c b/tools/power/cpupower/lib/powercap.c
index 0ce29ee4c2e4..a39ee1c89679 100644
--- a/tools/power/cpupower/lib/powercap.c
+++ b/tools/power/cpupower/lib/powercap.c
@@ -51,7 +51,7 @@ static int sysfs_get_enabled(char *path, int *mode)
close(fd);
return -1;
}> -
+ close(fd);
if (yes_no == '1') {
*mode = 1;
return 0;