From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966004AbcJYRbx (ORCPT ); Tue, 25 Oct 2016 13:31:53 -0400 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:42240 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941233AbcJYRbY (ORCPT ); Tue, 25 Oct 2016 13:31:24 -0400 Subject: Re: [PATCH] [v2] staging: iio: ad5933: avoid uninitialized variable in error case To: Lars-Peter Clausen , Arnd Bergmann , Greg Kroah-Hartman References: <20161024152226.2536749-1-arnd@arndb.de> <39545e74-af9b-cd31-c525-fba9f4c369b4@kernel.org> Cc: Michael Hennerich , Hartmut Knaack , Peter Meerwald-Stadler , Alison Schofield , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org From: Jonathan Cameron Message-ID: <26943ae6-ff2a-f521-cb66-1e98a1af8520@kernel.org> Date: Tue, 25 Oct 2016 18:31:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/10/16 18:00, Lars-Peter Clausen wrote: > On 10/25/2016 06:57 PM, Jonathan Cameron wrote: >> On 24/10/16 16:22, Arnd Bergmann wrote: >>> The ad5933_i2c_read function returns an error code to indicate >>> whether it could read data or not. However ad5933_work() ignores >>> this return code and just accesses the data unconditionally, >>> which gets detected by gcc as a possible bug: >>> >>> drivers/staging/iio/impedance-analyzer/ad5933.c: In function 'ad5933_work': >>> drivers/staging/iio/impedance-analyzer/ad5933.c:649:16: warning: 'status' may be used uninitialized in this function [-Wmaybe-uninitialized] >>> >>> This adds minimal error handling so we only evaluate the >>> data if it was correctly read. >>> >>> Link: https://patchwork.kernel.org/patch/8110281/ >>> Signed-off-by: Arnd Bergmann >> Looks good to me. >> >> Lars? >> > > Looks good, thanks. > > Acked-by: Lars-Peter Clausen Applied to the fixes-togreg branch of iio.git and marked for stable. thanks, Jonathan > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >