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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 5 May 2022 22:51:03 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Shubhrajyoti Datta <shubhrajyoti.datta@...inx.com>
Cc:     linux-serial@...r.kernel.org, michal.simek@...inx.com,
        jirislaby@...nel.org, git@...inx.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/7] tty: xilinx_uartps: Check clk_enable return value

On Fri, Apr 29, 2022 at 01:44:19PM +0530, Shubhrajyoti Datta wrote:
> Check for the clock enable return value.
> 
> Addresses-Coverity: Event check_return.
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@...inx.com>
> ---
>  drivers/tty/serial/xilinx_uartps.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index 868f4e587263..bf0415f0a194 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -1347,12 +1347,18 @@ static int cdns_uart_resume(struct device *device)
>  	unsigned long flags;
>  	u32 ctrl_reg;
>  	int may_wake;
> +	int ret;
>  
>  	may_wake = device_may_wakeup(device);
>  
>  	if (console_suspend_enabled && uart_console(port) && !may_wake) {
> -		clk_enable(cdns_uart->pclk);
> -		clk_enable(cdns_uart->uartclk);
> +		ret = clk_enable(cdns_uart->pclk);
> +		if (ret)
> +			return ret;
> +
> +		ret = clk_enable(cdns_uart->uartclk);
> +		if (ret)
> +			return ret;

Shouldn't you disable the clock you enabled if this fails here?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ