lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190322145828.GB6521@archlinux-ryzen>
Date:   Fri, 22 Mar 2019 07:58:28 -0700
From:   Nathan Chancellor <natechancellor@...il.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        clang-built-linux@...glegroups.com,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        Max Krummenacher <max.krummenacher@...adex.com>,
        Lee Jones <lee.jones@...aro.org>,
        Stefan Agner <stefan@...er.ch>, linux-iio@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: stmpe-adc: avoid harmless clang warning

On Fri, Mar 22, 2019 at 03:08:39PM +0100, Arnd Bergmann wrote:
> Clang points out a control flow bug, which happens to be harmless:
> 
> drivers/iio/adc/stmpe-adc.c:204:13: error: variable 'data' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> 
> The warning is sensible here, so let's just avoid the case by
> adding appropriate error handling.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  drivers/iio/adc/stmpe-adc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c
> index 37f4b74a5d32..ed3817c5c896 100644
> --- a/drivers/iio/adc/stmpe-adc.c
> +++ b/drivers/iio/adc/stmpe-adc.c
> @@ -205,6 +205,8 @@ static irqreturn_t stmpe_adc_isr(int irq, void *dev_id)
>  		/* Read value */
>  		stmpe_block_read(info->stmpe, STMPE_REG_TEMP_DATA, 2,
>  				(u8 *) &data);
> +	} else {
> +		return IRQ_NONE;
>  	}
>  
>  	info->value = (u32) be16_to_cpu(data);
> -- 
> 2.20.0
> 

I sent a similar patch, which is sitting in Jonathan's testing branch:

https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=e15146e4d4349b3f309f5591ea8de8d24071265f

Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ