From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751998AbdF1L7z (ORCPT ); Wed, 28 Jun 2017 07:59:55 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:35604 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751652AbdF1L7o (ORCPT ); Wed, 28 Jun 2017 07:59:44 -0400 Message-ID: <1498651173.22048.111.camel@coelho.fi> From: Luca Coelho To: Arnd Bergmann , Johannes Berg Cc: Emmanuel Grumbach , Intel Linux Wireless , Kalle Valo , Sara Sharon , Golan Ben-Ami , Liad Kaufman , Haim Dreyfuss , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 28 Jun 2017 14:59:33 +0300 In-Reply-To: <20170627152458.1103403-1-arnd@arndb.de> References: <20170627152458.1103403-1-arnd@arndb.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 91.156.4.241 X-SA-Exim-Mail-From: luca@coelho.fi Subject: Re: [PATCH] iwlwifi: mvm: fix iwl_mvm_sar_find_wifi_pkg corner case X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on farmhouse.coelho.fi) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-06-27 at 17:24 +0200, Arnd Bergmann wrote: > gcc warns about what it thinks is an uninitialized variable > access: > > drivers/net/wireless/intel/iwlwifi/mvm/fw.c: In function 'iwl_mvm_sar_find_wifi_pkg.isra.14': > drivers/net/wireless/intel/iwlwifi/mvm/fw.c:1102:5: error: 'wifi_pkg' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > That problem cannot really happen, as we check data->package.count > to ensure that the loop is entered at least once. > However, something that can indeed happen is returning an incorrect > wifi_pkg pointer in case none of the elements are what we are looking > for. > > This modifies the loop again, to only return a correct object, and > to shut up that warning. > > Fixes: c386dacb4ed6 ("iwlwifi: mvm: refactor SAR init to prepare for dynamic SAR") > Signed-off-by: Arnd Bergmann > --- Thanks, Arnd! I've pushed this to our internal tree and it will eventually reach the mainline, via our normal upstreaming process. -- Cheers, Luca.