From patchwork Wed Jan 8 05:46:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 208973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2774C00523 for ; Wed, 8 Jan 2020 05:46:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C469A206DA for ; Wed, 8 Jan 2020 05:46:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="A6QIdrqD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726079AbgAHFqv (ORCPT ); Wed, 8 Jan 2020 00:46:51 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:56552 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbgAHFqv (ORCPT ); Wed, 8 Jan 2020 00:46:51 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0085few2090356; Wed, 8 Jan 2020 05:46:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2019-08-05; bh=zS4z0v/EVz6a7/+RUPyIOd1+zQwhAhY4eZ6Wuv/yqHg=; b=A6QIdrqD71iKwdbNZTn/oxu+hSHfzAoDHTgP1KhUt2TYJL9JabzMNhuBhW3CeSKvpVXg sZ+OetV0ZpBTffw2+dBqjoj9jgHKPuvHorNwlMbQHLtKNiN7NwVx/DCWJKdEnOV+hQog qCSCc8T7CoCKqPw39VEDo40sMJ7tgTRLaDvbkIEYZJ5+HLkB6tBu81L/3N5caK1PVxVq 6gGoAEi9BwonDPAdcJM/ieqFk+DnBSWEMcNKUBHAuUx4jm+47kDq8q8QCUTakPy2GcFR VDD+7AMa77IiBzqfVPxIypLQr+Oi5JFCPf8r8OjlItmcvq9nR/Ed7uYO8+WnyCVhpbar Ug== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2xakbqskvv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 08 Jan 2020 05:46:39 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0085fSBW030628; Wed, 8 Jan 2020 05:46:39 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2xcjvetgb6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 08 Jan 2020 05:46:38 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0085kbRj015837; Wed, 8 Jan 2020 05:46:37 GMT Received: from kili.mountain (/129.205.23.165) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 07 Jan 2020 21:46:37 -0800 Date: Wed, 8 Jan 2020 08:46:29 +0300 From: Dan Carpenter To: Shuah Khan , Michal =?iso-8859-1?q?Koutn=FD?= Cc: Tejun Heo , Roman Gushchin , Alex Shi , linux-kselftest@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] selftests: Uninitialized variable in test_cgcore_proc_migration() Message-ID: <20200108054629.jtq36feyhxsfhf6u@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9493 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001080049 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9493 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001080049 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 --- 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];