From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hmxXG-0003fR-6q for ath10k@lists.infradead.org; Mon, 15 Jul 2019 09:44:43 +0000 From: Kalle Valo Subject: Re: [PATCH] ath10k: work around uninitialized vht_pfr variable References: <20190708125050.3689133-1-arnd@arndb.de> Date: Mon, 15 Jul 2019 12:44:33 +0300 In-Reply-To: <20190708125050.3689133-1-arnd@arndb.de> (Arnd Bergmann's message of "Mon, 8 Jul 2019 14:50:06 +0200") Message-ID: <87v9w3pr7i.fsf@codeaurora.org> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Arnd Bergmann Cc: Sriram R , Miaoqing Pan , Pradeep kumar Chitrapu , Balaji Pothunoori , Brian Norris , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, clang-built-linux@googlegroups.com, netdev@vger.kernel.org, Rakesh Pillai , Wen Gong , "David S. Miller" Arnd Bergmann writes: > As clang points out, the vht_pfr is assigned to a struct member > without being initialized in one case: > > drivers/net/wireless/ath/ath10k/mac.c:7528:7: error: variable 'vht_pfr' is used uninitialized whenever 'if' condition > is false [-Werror,-Wsometimes-uninitialized] > if (!ath10k_mac_can_set_bitrate_mask(ar, band, mask, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7551:20: note: uninitialized use occurs here > arvif->vht_pfr = vht_pfr; > ^~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7528:3: note: remove the 'if' if its condition is always true > if (!ath10k_mac_can_set_bitrate_mask(ar, band, mask, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7483:12: note: initialize the variable 'vht_pfr' to silence this warning > u8 vht_pfr; > > Add an explicit but probably incorrect initialization here. > I suspect we want a better fix here, but chose this approach to > illustrate the issue. > > Fixes: 8b97b055dc9d ("ath10k: fix failure to set multiple fixed rate") > Signed-off-by: Arnd Bergmann I'll queue this for v5.3. -- Kalle Valo _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k