Messages in this thread | | | Date | Tue, 18 Apr 2023 09:42:05 -0600 | Subject | Re: [PATCH v4] cpupower:Fix resource leaks in sysfs_get_enabled() | From | Shuah Khan <> |
| |
On 4/17/23 19:30, Hao Zeng wrote: > 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> > --- > tools/power/cpupower/lib/powercap.c | 23 ++++++++++++++++------- > 1 file changed, 16 insertions(+), 7 deletions(-) >
Thank you.
Applied to git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git cpupower branch for Linux 6.4-rc1
thanks, -- Shuah
| |