lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7147a531-2537-81e6-6c4b-2c3c98c6ec59@arm.com>
Date:   Wed, 22 Dec 2021 10:23:19 +0000
From:   Vladimir Murzin <vladimir.murzin@....com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>, gregkh@...uxfoundation.org,
        jirislaby@...nel.org, liviu.dudau@....com, sudeep.holla@....com,
        lorenzo.pieralisi@....com
Cc:     linux-serial@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] serial: mps2-uart: Check for error irq

On 12/22/21 3:36 AM, Jiasheng Jiang wrote:
> I find that platform_get_irq() will not always succeed.
> It will return error irq in case there is no suitable irq.
> Therefore, it might be better to check it if order to avoid the use of
> error irq.
> 
> Fixes: 041f031def33 ("serial: mps2-uart: add MPS2 UART driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  drivers/tty/serial/mps2-uart.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/tty/serial/mps2-uart.c b/drivers/tty/serial/mps2-uart.c
> index 587b42f754cb..117d9896051f 100644
> --- a/drivers/tty/serial/mps2-uart.c
> +++ b/drivers/tty/serial/mps2-uart.c
> @@ -585,10 +585,20 @@ static int mps2_init_port(struct platform_device *pdev,
>  
>  	if (mps_port->flags & UART_PORT_COMBINED_IRQ) {
>  		mps_port->port.irq = platform_get_irq(pdev, 0);
> +		if (mps_port->port.irq < 0)
> +			return mps_port->port.irq;
>  	} else {
>  		mps_port->rx_irq = platform_get_irq(pdev, 0);
> +		if (mps_port->rx_irq < 0)
> +			return mps_port->rx_irq;
> +
>  		mps_port->tx_irq = platform_get_irq(pdev, 1);
> +		if (mps_port->tx_irq < 0)
> +			return mps_port->tx_irq;
> +
>  		mps_port->port.irq = platform_get_irq(pdev, 2);
> +		if (mps_port->port.irq < 0)
> +			return mps_port->port.irq;
>  	}
>  
>  	return ret;
> 

Acked-by: Vladimir Murzin <vladimir.murzin@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ