From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Shuah Khan" <shuah@kernel.org>, "Michal Koutný" <mkoutny@suse.com>
Cc: Tejun Heo <tj@kernel.org>, Roman Gushchin <guro@fb.com>,
Alex Shi <alex.shi@linux.alibaba.com>,
linux-kselftest@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] selftests: Uninitialized variable in test_cgcore_proc_migration()
Date: Wed, 8 Jan 2020 08:46:29 +0300 [thread overview]
Message-ID: <20200108054629.jtq36feyhxsfhf6u@kili.mountain> (raw)
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
next reply other threads:[~2020-01-08 5:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 5:46 Dan Carpenter [this message]
2020-01-08 10:17 ` [PATCH] selftests: Uninitialized variable in test_cgcore_proc_migration() Michal Koutný
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200108054629.jtq36feyhxsfhf6u@kili.mountain \
--to=dan.carpenter@oracle.com \
--cc=alex.shi@linux.alibaba.com \
--cc=guro@fb.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).