summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChris Morgan <macromorgan@hotmail.com>2022-11-17 22:09:18 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2022-11-17 22:14:43 -0800
commitc7f43645de7895a8e90cb267a9b3c46e989d8ca6 (patch)
tree1a35cf76e2d6bb0df31848e9d659ff2a6f7a2a1d /drivers
parent5e7a0af793ce7ed528117145f856224deb81b7a7 (diff)
downloadlinux-stable-c7f43645de7895a8e90cb267a9b3c46e989d8ca6.tar.gz
linux-stable-c7f43645de7895a8e90cb267a9b3c46e989d8ca6.tar.bz2
linux-stable-c7f43645de7895a8e90cb267a9b3c46e989d8ca6.zip
Input: hynitron_cstxxx - initialize tmp to 0 to fix uninitialized variable issue
In the very unlikely event the cst3xx_i2c_write() fails inside of the cst3xx_bootloader_enter() function 5 times in a row, the uninitalized value of tmp will get compared to CST3XX_BOOTLDR_CHK_VAL. Initialize the value of tmp to 0 so that in this unlikely event we are comparing 0 instead of an uninitalized variable. Fixes: 66603243f528 ("Input: add driver for Hynitron cstxxx touchscreens") Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Reported-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/r/20221117195921.2291-1-macroalpha82@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/hynitron_cstxxx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/hynitron_cstxxx.c b/drivers/input/touchscreen/hynitron_cstxxx.c
index 0b9a99c6f221..e86c85addb38 100644
--- a/drivers/input/touchscreen/hynitron_cstxxx.c
+++ b/drivers/input/touchscreen/hynitron_cstxxx.c
@@ -210,7 +210,7 @@ static int cst3xx_bootloader_enter(struct i2c_client *client)
{
int err;
u8 retry;
- u32 tmp;
+ u32 tmp = 0;
unsigned char buf[3];
for (retry = 0; retry < 5; retry++) {