diff mbox series

[4.19,37/39] Input: i8042 - fix error return code in i8042_setup_aux()

Message ID 20201210142604.116728762@linuxfoundation.org
State Superseded
Headers show
Series None | expand

Commit Message

Greg KH Dec. 10, 2020, 2:27 p.m. UTC
From: Luo Meng <luomeng12@huawei.com>

commit 855b69857830f8d918d715014f05e59a3f7491a0 upstream.

Fix to return a negative error code from the error handling case
instead of 0 in function i8042_setup_aux(), as done elsewhere in this
function.

Fixes: f81134163fc7 ("Input: i8042 - use platform_driver_probe")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Luo Meng <luomeng12@huawei.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201123133420.4071187-1-luomeng12@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/input/serio/i8042.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Pavel Machek Dec. 11, 2020, 10:35 p.m. UTC | #1
Hi!

> From: Luo Meng <luomeng12@huawei.com>

> 

> commit 855b69857830f8d918d715014f05e59a3f7491a0 upstream.

> 

> Fix to return a negative error code from the error handling case

> instead of 0 in function i8042_setup_aux(), as done elsewhere in this

> function.

> 

> Fixes: f81134163fc7 ("Input: i8042 - use platform_driver_probe")


I'd recommend not taking this. It is not known to fix
end-user-visible-bug, i8042 is normally quite fragile, and the patch
is less then month old so did not get adequate testing.

Yes, code looks cleaner after the fix. With i8042, that does not mean
much.

Best regards,
								Pavel


> --- a/drivers/input/serio/i8042.c

> +++ b/drivers/input/serio/i8042.c

> @@ -1472,7 +1472,8 @@ static int __init i8042_setup_aux(void)

>  	if (error)

>  		goto err_free_ports;

>  

> -	if (aux_enable())

> +	error = aux_enable();

> +	if (error)

>  		goto err_free_irq;

>  

>  	i8042_aux_irq_registered = true;

> 


-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
diff mbox series

Patch

--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1472,7 +1472,8 @@  static int __init i8042_setup_aux(void)
 	if (error)
 		goto err_free_ports;
 
-	if (aux_enable())
+	error = aux_enable();
+	if (error)
 		goto err_free_irq;
 
 	i8042_aux_irq_registered = true;