Received: by 10.223.185.116 with SMTP id b49csp5968071wrg; Wed, 7 Mar 2018 22:52:56 -0800 (PST) X-Google-Smtp-Source: AG47ELt2dJvB8wMEWZYVPlUaBXCjskrpW/gXSW3vviwn/70yQM+TFHEyTG0/1/tzSPDqYSMmJoZk X-Received: by 10.99.177.6 with SMTP id r6mr20075073pgf.76.1520491975804; Wed, 07 Mar 2018 22:52:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491975; cv=none; d=google.com; s=arc-20160816; b=XGZXFRzvm97K58JqVbfsdD5T2HDEWeXsZefgMlbxen6fbSmZXpY2idxcredDEclMm8 YO90h2j0L44fp6xkA+gfnkHCllAc9gG4Jhli5TLXGKHTxK6/3KqLtTxoT2v0uFBvTc8v tWHaixPeDpXbHM/hAjpCuvN/f/MF7MBLk2XcZG93+0UMHC3GW4Rnx/UpUB2Lkdh8hdsd kw3FKybvUxs2iqBHNDI2Ow/0Nc3neFjtdh2gwAM7cttNezyimOpcqrc9Im1LDBywNfub pdhZGAVtGwlYuAOQ72RZuwFUxsAsHqOAESxC+OGduinCec0Z44yhCW0trvEhXcfFGNEl S8AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Iu00a8ij2t8o1rLxYGvIW8Vy/CKgp6jYCudrHxKiEKQ=; b=XZobbOoTXxSHgyfIV2V1cGqljj16xykqwUadeB66PSl9P2UMQezC4+hy3I/UFR3yz2 0I4FD0uDym9Z+BqK4J99kqorCbLK2sbGWE+jEkZA2hjek3SIJ7SDBeoOkKOOvvoi81eI HkIBPLZR7z1UR4A1ikOAxn6N7kkp7tliGf8wigUoQnYlzRRfEPLA3HmP7kI61FboR73u xU9KC/qndoumQpoaPmyzn9TPH51lklKSGb0LDKAM7z2wKQuOqZTCPHcbgES6K1HOmScW BDtqY0Vlqhsa9zXF3PEWthr505pGH2X7wEaY5n6ZNTcci8zkNFbAqJtejaKtxPMwEvfe OLQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=j6q/EXCa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 66si15116508pfw.112.2018.03.07.22.52.41; Wed, 07 Mar 2018 22:52:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=j6q/EXCa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965147AbeCHGuS (ORCPT + 99 others); Thu, 8 Mar 2018 01:50:18 -0500 Received: from mail-sn1nam01on0120.outbound.protection.outlook.com ([104.47.32.120]:33969 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965058AbeCHE6O (ORCPT ); Wed, 7 Mar 2018 23:58:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Iu00a8ij2t8o1rLxYGvIW8Vy/CKgp6jYCudrHxKiEKQ=; b=j6q/EXCa/JIEovxFgK1vV5nih8UvxrPbR24TToWZUpS54ERYVRvoskSBIzawSrSc/n0leV9ktoCtC3xLThVyiv2E0WLY/fpKfdHtyMcHiTtC4A2f1kSTKai5VTWLMUNvol7Lo0FDJQqZJDU2dCBcLY2bHYCiQC8lAvLuORE1YKM= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0888.namprd21.prod.outlook.com (52.132.132.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Thu, 8 Mar 2018 04:58:11 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:58:11 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Nicolas Iooss , Kalle Valo , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 15/67] rtlwifi: always initialize variables given to RT_TRACE() Thread-Topic: [PATCH AUTOSEL for 4.14 15/67] rtlwifi: always initialize variables given to RT_TRACE() Thread-Index: AQHTtpn6TDf0vitX5UyqNi5KSttV5w== Date: Thu, 8 Mar 2018 04:57:38 +0000 Message-ID: <20180308045641.7814-15-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0888;7:r5k9tkR3XKMleVaGuyIxwF6IOCm1a1fevSrppNVC5pAMzFpNNUOL9Cqd5fVMFLi44PbAv8x4sYw97nUPNSfO/hnnKr4JBhsSZ4OFkLzQtqeKPYKlYrCjyXJQTRZL5Bfo9WCO+TfG5IPUMv6CiFDMjcWPYPvFbIiQLTFCAMZ0VW2T8RimKpilOV2lQt1ZBBErF0HvSvGLwNI+bQ6mPDWaid+MMJwI6iPWVBTFEnBkmeObhL53SioKV5sTXhtuvXGw;20:/ofsc93X7aafDxKn+IidzHj8e2kESQl+auE72weFdfAZpECAzkXoIevpYUJSeHuk6gNliC6/VYKIosRb3W7Aj25NQSh/tksefjcwWLoi++YESJ5eCPgGrX6VwwuYdEuWiKN1yeZgvbiJUC/UlTOMT+OXpw7IsQJ2SLoB3dk0vAI= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 94a29229-7c26-43fd-2173-08d584b13152 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0888; x-ms-traffictypediagnostic: DM5PR2101MB0888: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(944501244)(52105095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0888;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0888; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(346002)(376002)(39380400002)(396003)(189003)(199004)(6116002)(99286004)(2950100002)(6512007)(6666003)(10290500003)(36756003)(5660300001)(106356001)(1076002)(22452003)(3846002)(97736004)(316002)(53936002)(68736007)(105586002)(4326008)(25786009)(54906003)(478600001)(2501003)(186003)(66066001)(76176011)(3280700002)(86362001)(575784001)(14454004)(2900100001)(5250100002)(110136005)(305945005)(7736002)(72206003)(3660700001)(6436002)(2906002)(26005)(6486002)(10090500001)(8676002)(81156014)(107886003)(81166006)(86612001)(6506007)(59450400001)(8936002)(102836004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0888;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ur+yiygIkxD+0O4gAd6lnn5r1BhRziSrJPcETk3wmwXSLokH/2PaaOl27dkNiPkICMUwyQ4cGQb/N/PsAcmm0+7qGpZcKIvbksrHIbFOPOJr9MpvXogdQouu2WZGa0jCJkLYEKWcfw+BrBVMaf4Waxe6rgYBIpu5owZr4WlSXFLvQHg0GeDGMfzEyL1Sximsz7I2d/9s/gsmfyhJNUCq9PqoX2JWW2YmwWWxkgvxlBkEVISryFWDVy4amTfU7NSEDfJvyZRLofbKTXfm9U/tKYd30URLwlR8lnEbBh58t5KdDHwkalysF9JJULIngTFiMu3A3wxJjyeWqiyq/LniGQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94a29229-7c26-43fd-2173-08d584b13152 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:38.0964 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0888 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Iooss [ Upstream commit e4779162f7377baa9fb9a044555ecaae22c3f125 ] In rtl_rx_ampdu_apply(), when rtlpriv->cfg->ops->get_btc_status() returns false, RT_TRACE() is called with the values of variables reject_agg and agg_size, which have not been initialized. Always initialize these variables in order to prevent using uninitialized values. This issue has been found with clang. The compiler reported: drivers/net/wireless/realtek/rtlwifi/base.c:1665:6: error: variable 'agg_size' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (rtlpriv->cfg->ops->get_btc_status()) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtlwifi/base.c:1671:31: note: uninitialized use occurs here reject_agg, ctrl_agg_size, agg_size); ^~~~~~~~ drivers/net/wireless/realtek/rtlwifi/base.c:1665:6: error: variable 'reject_agg' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (rtlpriv->cfg->ops->get_btc_status()) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtlwifi/base.c:1671:4: note: uninitialized use occurs here reject_agg, ctrl_agg_size, agg_size); ^~~~~~~~~~ Fixes: 2635664e6e4a ("rtlwifi: Add rx ampdu cfg for btcoexist.") Signed-off-by: Nicolas Iooss Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtlwifi/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wire= less/realtek/rtlwifi/base.c index ea18aa7afecb..93256f8bc0b5 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -1664,7 +1664,7 @@ int rtl_tx_agg_oper(struct ieee80211_hw *hw, void rtl_rx_ampdu_apply(struct rtl_priv *rtlpriv) { struct rtl_btc_ops *btc_ops =3D rtlpriv->btcoexist.btc_ops; - u8 reject_agg, ctrl_agg_size =3D 0, agg_size; + u8 reject_agg =3D 0, ctrl_agg_size =3D 0, agg_size =3D 0; =20 if (rtlpriv->cfg->ops->get_btc_status()) btc_ops->btc_get_ampdu_cfg(rtlpriv, &reject_agg, --=20 2.14.1