lkml.org 
[lkml]   [2021]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][next] Input: resistive-adc-touch: Fix uninitialized variable 'press'
Hi Colin,

On Thu, Jun 03, 2021 at 11:08:09PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> In the case where st->ch_map[GRTS_CH_PRESSURE] < GRTS_MAX_CHANNELS is false
> and also st->ch_map[GRTS_CH_Z1] < GRTS_MAX_CHANNELS is false the variable
> press is not initialized and contains garbage. This affects a later
> comparison of press < st->pressure_min.

If neither of the conditions is true, then st->pressure is also false,
and we will not be evaluating condition involving "press". However it is
impossible for the compiler/Coverity to figure this out, so I'll apply
the patch adjusting the description a bit.

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2021-06-06 01:21    [W:0.052 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site