[2/2] serial: liteuart: Correct error rollback

Message ID 20230123173857.40695-3-ilpo.jarvinen@linux.intel.com
State New
Headers
Series serial: fix recently introduced problems in tty-next |

Commit Message

Ilpo Järvinen Jan. 23, 2023, 5:38 p.m. UTC
  Goto to the correct rollback label instead of directly returning.

Fixes: 5602cf99dcdc ("serial: liteuart: add IRQ support for the RX path")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/liteuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Gabriel L. Somlo Jan. 23, 2023, 5:42 p.m. UTC | #1
On Mon, Jan 23, 2023 at 07:38:57PM +0200, Ilpo Järvinen wrote:
> Goto to the correct rollback label instead of directly returning.
> 
> Fixes: 5602cf99dcdc ("serial: liteuart: add IRQ support for the RX path")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
>  drivers/tty/serial/liteuart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c
> index ef557d59e4c8..192ad681de35 100644
> --- a/drivers/tty/serial/liteuart.c
> +++ b/drivers/tty/serial/liteuart.c
> @@ -313,7 +313,7 @@ static int liteuart_probe(struct platform_device *pdev)
>  
>  	ret = platform_get_irq_optional(pdev, 0);
>  	if (ret < 0 && ret != -ENXIO)
> -		return ret;
> +		goto err_erase_id;

That was my mistake, sorry, and thanks for the super-quick fix! :)

Reviewed-by: Gabriel Somlo <gsomlo@gmail.com>

>  	if (ret > 0)
>  		port->irq = ret;
>  
> -- 
> 2.30.2
>
  

Patch

diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c
index ef557d59e4c8..192ad681de35 100644
--- a/drivers/tty/serial/liteuart.c
+++ b/drivers/tty/serial/liteuart.c
@@ -313,7 +313,7 @@  static int liteuart_probe(struct platform_device *pdev)
 
 	ret = platform_get_irq_optional(pdev, 0);
 	if (ret < 0 && ret != -ENXIO)
-		return ret;
+		goto err_erase_id;
 	if (ret > 0)
 		port->irq = ret;