]> git.baikalelectronics.ru Git - kernel.git/commit
testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Fri, 8 Apr 2022 07:24:31 +0000 (12:54 +0530)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 12 Apr 2022 19:54:49 +0000 (13:54 -0600)
commitb13b1474201bf33e2d6ee85a1297ab5ed4ad116d
treed8aae179971f77e6f317d34185c238df1d1c2ba4
parent096e8b18ac3daca921f53d35754dc40ec7b221cb
testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set

The selftest "mqueue/mq_perf_tests.c" use CPU_ALLOC to allocate
CPU set. This cpu set is used further in pthread_attr_setaffinity_np
and by pthread_create in the code. But in current code, allocated
cpu set is not freed.

Fix this issue by adding CPU_FREE in the "shutdown" function which
is called in most of the error/exit path for the cleanup. There are
few error paths which exit without using shutdown. Add a common goto
error path with CPU_FREE for these cases.

Fixes: d3f0d6daebc9 ("tools/selftests: add mq_perf_tests")
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/mqueue/mq_perf_tests.c