linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: Uninitialized variable in test_cgcore_proc_migration()
@ 2020-01-08  5:46 Dan Carpenter
  2020-01-08 10:17 ` Michal Koutný
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-01-08  5:46 UTC (permalink / raw)
  To: Shuah Khan, Michal Koutný
  Cc: Tejun Heo, Roman Gushchin, Alex Shi, linux-kselftest, kernel-janitors

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>
---
 tools/testing/selftests/cgroup/test_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c
index c5ca669feb2b..e19ce940cd6a 100644
--- a/tools/testing/selftests/cgroup/test_core.c
+++ b/tools/testing/selftests/cgroup/test_core.c
@@ -369,7 +369,7 @@ static void *dummy_thread_fn(void *arg)
 static int test_cgcore_proc_migration(const char *root)
 {
 	int ret = KSFT_FAIL;
-	int t, c_threads, n_threads = 13;
+	int t, c_threads = 0, n_threads = 13;
 	char *src = NULL, *dst = NULL;
 	pthread_t threads[n_threads];
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: Uninitialized variable in test_cgcore_proc_migration()
  2020-01-08  5:46 [PATCH] selftests: Uninitialized variable in test_cgcore_proc_migration() Dan Carpenter
@ 2020-01-08 10:17 ` Michal Koutný
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Koutný @ 2020-01-08 10:17 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Shuah Khan, Tejun Heo, Roman Gushchin, Alex Shi, linux-kselftest,
	kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

On Wed, Jan 08, 2020 at 08:46:29AM +0300, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The "c_threads" variable is used in the error handling code before it
> has been initialized
Thank you for fixing this.

Acked-by: Michal Koutný <mkoutny@suse.com>

Michal

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-08 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08  5:46 [PATCH] selftests: Uninitialized variable in test_cgcore_proc_migration() Dan Carpenter
2020-01-08 10:17 ` Michal Koutný

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).