Linux-kselftest Archive on lore.kernel.org
 help / color / 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	[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, back to index

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ý

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git