diff options
author | Hao Zeng <[email protected]> | 2023-04-18 09:30:56 +0800 |
---|---|---|
committer | Shuah Khan <[email protected]> | 2023-05-08 08:11:24 -0600 |
commit | e652be0f59d4ba4d5c636b1f7f4dcb73aae049fa (patch) | |
tree | d511b59633d2d7e50f53baeb9ab5bded66425b64 /lib/mpi/mpi-internal.h | |
parent | ac9a78681b921877518763ba0e89202254349d1b (diff) |
cpupower:Fix resource leaks in sysfs_get_enabled()
The sysfs_get_enabled() opened file processor not closed,
may cause a file handle leak.
Putting error handling and resource cleanup code together
makes the code easy to maintain and read.
Removed the unnecessary else if branch from the original
function, as it should return an error in cases other than '0'.
Signed-off-by: Hao Zeng <[email protected]>
Suggested-by: Shuah Khan <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-internal.h')
0 files changed, 0 insertions, 0 deletions