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: <YygrTldNcRSVFacX@kroah.com>
Date:   Mon, 19 Sep 2022 10:41:50 +0200
From:   Greg KH <greg@...ah.com>
To:     Li Zhong <floridsleeves@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
        jirislaby@...nel.org, bcm-kernel-feedback-list@...adcom.com,
        alcooperx@...il.com
Subject: Re: [PATCH v1] drivers/tty/serial/8250: check the return value of
 clk_set_rate()

On Mon, Sep 19, 2022 at 01:15:23AM -0700, Li Zhong wrote:
> Check the return of clk_set_rate() which could fail if there is error
> setting the rate.
> 
> Signed-off-by: Li Zhong <floridsleeves@...il.com>
> ---
>  drivers/tty/serial/8250/8250_bcm7271.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
> index 8efdc271eb75..9014853d6e35 100644
> --- a/drivers/tty/serial/8250/8250_bcm7271.c
> +++ b/drivers/tty/serial/8250/8250_bcm7271.c
> @@ -671,7 +671,9 @@ static void init_real_clk_rates(struct device *dev, struct brcmuart_priv *priv)
>  			priv->real_rates[x] = clk_get_rate(priv->baud_mux_clk);
>  		}
>  	}
> -	clk_set_rate(priv->baud_mux_clk, priv->default_mux_rate);
> +	rc = clk_set_rate(priv->baud_mux_clk, priv->default_mux_rate);
> +	if (rc)
> +		dev_err(dev, "Error restoring default BAUD MUX clock\n");

What does this actually help with?  Shouldn't you recover properly from
an error instead of telling the user something bad went wrong and
nothing can be done?

This is not a correct fix at all, sorry.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ