提交 c7f43645 编写于 作者: C Chris Morgan 提交者: Dmitry Torokhov

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: 66603243 ("Input: add driver for Hynitron cstxxx touchscreens")
Signed-off-by: NChris Morgan <macromorgan@hotmail.com>
Reported-by: NDan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/20221117195921.2291-1-macroalpha82@gmail.comSigned-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 5e7a0af7
...@@ -210,7 +210,7 @@ static int cst3xx_bootloader_enter(struct i2c_client *client) ...@@ -210,7 +210,7 @@ static int cst3xx_bootloader_enter(struct i2c_client *client)
{ {
int err; int err;
u8 retry; u8 retry;
u32 tmp; u32 tmp = 0;
unsigned char buf[3]; unsigned char buf[3];
for (retry = 0; retry < 5; retry++) { for (retry = 0; retry < 5; retry++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册