diff options
author | Hao Zeng | 2023-04-18 09:30:56 +0800 |
---|---|---|
committer | Shuah Khan | 2023-05-08 08:11:24 -0600 |
commit | e652be0f59d4ba4d5c636b1f7f4dcb73aae049fa (patch) | |
tree | d511b59633d2d7e50f53baeb9ab5bded66425b64 /net/smc | |
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 <zenghao@kylinos.cn>
Suggested-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'net/smc')
0 files changed, 0 insertions, 0 deletions