Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: Uninitialized variable in test_cgcore_proc_migration()

The "c_threads" variable is used in the error handling code before it
has been initialized

Fixes: 11318989c381 ("selftests: cgroup: Add task migration tests")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Dan Carpenter and committed by
Shuah Khan
192c197c 5f70bde2

+1 -1
+1 -1
tools/testing/selftests/cgroup/test_core.c
··· 369 369 static int test_cgcore_proc_migration(const char *root) 370 370 { 371 371 int ret = KSFT_FAIL; 372 - int t, c_threads, n_threads = 13; 372 + int t, c_threads = 0, n_threads = 13; 373 373 char *src = NULL, *dst = NULL; 374 374 pthread_t threads[n_threads]; 375 375