diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-06-06 02:09:36 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2021-06-06 02:41:08 +0300 |
commit | 6cdc1ef84eacca85642828840f2ec4f84130c9b6 (patch) | |
tree | 3ee7de258477ed057307af98037680ee7ab8a197 /include/linux/input | |
parent | 2fcbda9a822db2ff990fd9f19075843737bc1685 (diff) | |
download | linux-6cdc1ef84eacca85642828840f2ec4f84130c9b6.tar.xz |
Input: resistive-adc-touch - fix uninitialized variable 'press'
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. In this situation
st->pressure is also false, so we do not actually use press value, but
it is impossible for the compiler to realize this, and it emits
"uninitialized variable" warning. Fix this by initializing press
to 0 and allows us to also remove an else clause that sets press to 0.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 60b7db914ddd ("Input: resistive-adc-touch - rework mapping of channels")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210603220809.155118-1-colin.king@canonical.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'include/linux/input')
0 files changed, 0 insertions, 0 deletions