[PATCH] Input: iqs5xx - initialize an uninitialized variable

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE2029d LANDED

Landed in mainline as 7a6a53b2b1a3 on 2021-01-28.

2 messages, 2 authors, 2021-01-25 · open the first message on its own page

[PATCH] Input: iqs5xx - initialize an uninitialized variable

From: Jeff LaBundy <hidden>
Date: 2021-01-25 16:36:47

If execution jumps to the err_kfree label, error_bl is evaluated
before it is initialized. Fix this by initializing it to zero.

Fixes: 2539da6677b6 ("Input: iqs5xx - preserve bootloader errors")
Reported-by: kernel test robot <redacted>
Signed-off-by: Jeff LaBundy <redacted>
---
 drivers/input/touchscreen/iqs5xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
index 05e0c6f..54f3003 100644
--- a/drivers/input/touchscreen/iqs5xx.c
+++ b/drivers/input/touchscreen/iqs5xx.c
@@ -852,7 +852,7 @@ static int iqs5xx_fw_file_parse(struct i2c_client *client,
 static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file)
 {
 	struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client);
-	int error, error_bl;
+	int error, error_bl = 0;
 	u8 *pmap;
 
 	if (iqs5xx->bl_status == IQS5XX_BL_STATUS_NONE)
-- 
2.7.4

Re: [PATCH] Input: iqs5xx - initialize an uninitialized variable

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2021-01-25 18:15:08

On Mon, Jan 25, 2021 at 10:35:00AM -0600, Jeff LaBundy wrote:
If execution jumps to the err_kfree label, error_bl is evaluated
before it is initialized. Fix this by initializing it to zero.

Fixes: 2539da6677b6 ("Input: iqs5xx - preserve bootloader errors")
Reported-by: kernel test robot <redacted>
Signed-off-by: Jeff LaBundy <redacted>
Applied, thank you.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help