]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/resctrl: Close perf value read fd on errors
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 17 Jul 2023 13:14:52 +0000 (16:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:31 +0000 (12:22 +0200)
commit3af6f77e8090e55d35e2c9f2c45fba5c140faf41
tree67bbd6e8b3ab8105baff2419b774cf7fb1811496
parent4505ad996b6666d2bce291400a258152316d64d5
selftests/resctrl: Close perf value read fd on errors

[ Upstream commit 51a0c3b7f028169e40db930575dd01fe81c3e765 ]

Perf event fd (fd_lm) is not closed when run_fill_buf() returns error.

Close fd_lm only in cat_val() to make it easier to track it is always
closed.

Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest")
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Tested-by: Shaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/resctrl/cache.c