linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] Input: iqs5xx: Ensure error_bl is initialized on error exit path
@ 2021-01-28 12:19 Colin King
  2021-01-28 14:39 ` Jeff LaBundy
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2021-01-28 12:19 UTC (permalink / raw)
  To: Dmitry Torokhov, Jeff LaBundy, linux-input; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently if the call to qs5xx_fw_file_parse fails the error return
exit path will read the uninitialized variable error_bl. Fix this
by ensuring error_bl is initialized to zero.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 2539da6677b6 ("Input: iqs5xx - preserve bootloader errors")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 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 05e0c6ff217b..54f30038dca4 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.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] Input: iqs5xx: Ensure error_bl is initialized on error exit path
  2021-01-28 12:19 [PATCH][next] Input: iqs5xx: Ensure error_bl is initialized on error exit path Colin King
@ 2021-01-28 14:39 ` Jeff LaBundy
  2021-01-28 14:55   ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff LaBundy @ 2021-01-28 14:39 UTC (permalink / raw)
  To: Colin King; +Cc: Dmitry Torokhov, linux-input, kernel-janitors, linux-kernel

Hi Colin,

On Thu, Jan 28, 2021 at 12:19:03PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently if the call to qs5xx_fw_file_parse fails the error return
> exit path will read the uninitialized variable error_bl. Fix this
> by ensuring error_bl is initialized to zero.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: 2539da6677b6 ("Input: iqs5xx - preserve bootloader errors")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

This was fixed in [1]; it just needs pushed.

[1] https://patchwork.kernel.org/patch/12043701

> ---
>  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 05e0c6ff217b..54f30038dca4 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.29.2
> 

Kind regards,
Jeff LaBundy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] Input: iqs5xx: Ensure error_bl is initialized on error exit path
  2021-01-28 14:39 ` Jeff LaBundy
@ 2021-01-28 14:55   ` Colin Ian King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2021-01-28 14:55 UTC (permalink / raw)
  To: Jeff LaBundy; +Cc: Dmitry Torokhov, linux-input, kernel-janitors, linux-kernel

On 28/01/2021 14:39, Jeff LaBundy wrote:
> Hi Colin,
> 
> On Thu, Jan 28, 2021 at 12:19:03PM +0000, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently if the call to qs5xx_fw_file_parse fails the error return
>> exit path will read the uninitialized variable error_bl. Fix this
>> by ensuring error_bl is initialized to zero.
>>
>> Addresses-Coverity: ("Uninitialized scalar variable")
>> Fixes: 2539da6677b6 ("Input: iqs5xx - preserve bootloader errors")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> This was fixed in [1]; it just needs pushed.

OK, thanks for letting me know.
> 
> [1] https://patchwork.kernel.org/patch/12043701
> 
>> ---
>>  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 05e0c6ff217b..54f30038dca4 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.29.2
>>
> 
> Kind regards,
> Jeff LaBundy
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-28 14:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 12:19 [PATCH][next] Input: iqs5xx: Ensure error_bl is initialized on error exit path Colin King
2021-01-28 14:39 ` Jeff LaBundy
2021-01-28 14:55   ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).