From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759208AbcJYRBM (ORCPT ); Tue, 25 Oct 2016 13:01:12 -0400 Received: from www381.your-server.de ([78.46.137.84]:46222 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754818AbcJYRBK (ORCPT ); Tue, 25 Oct 2016 13:01:10 -0400 Subject: Re: [PATCH] [v2] staging: iio: ad5933: avoid uninitialized variable in error case To: Jonathan Cameron , 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: Lars-Peter Clausen Message-ID: Date: Tue, 25 Oct 2016 19:00:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <39545e74-af9b-cd31-c525-fba9f4c369b4@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Authenticated-Sender: lars@metafoo.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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