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: <20230323083451a4171c6b@mail.local>
Date:   Thu, 23 Mar 2023 09:34:51 +0100
From:   Alexandre Belloni <alexandre.belloni@...tlin.com>
To:     Dhruva Gole <d-gole@...com>
Cc:     Vibhore Vardhan <vibhore@...com>, linux-rtc@...r.kernel.org,
        Alessandro Zummo <a.zummo@...ertech.it>,
        linux-kernel@...r.kernel.org, Nishanth Menon <nm@...com>
Subject: Re: [PATCH] rtc: k3: handle errors while enabling wake irq

On 23/03/2023 13:49:42+0530, Dhruva Gole wrote:
> Due to the potential failure of enable_irq_wake(), it would be better to
> check it and return error if it fails.
> 
> Fixes: b09d633575e5 ("rtc: Introduce ti-k3-rtc")
> Cc: Nishanth Menon <nm@...com>
> Signed-off-by: Dhruva Gole <d-gole@...com>
> ---
>  drivers/rtc/rtc-ti-k3.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-ti-k3.c b/drivers/rtc/rtc-ti-k3.c
> index ba23163cc042..ef9d7e1cf92e 100644
> --- a/drivers/rtc/rtc-ti-k3.c
> +++ b/drivers/rtc/rtc-ti-k3.c
> @@ -630,9 +630,18 @@ MODULE_DEVICE_TABLE(of, ti_k3_rtc_of_match_table);
>  static int __maybe_unused ti_k3_rtc_suspend(struct device *dev)
>  {
>  	struct ti_k3_rtc *priv = dev_get_drvdata(dev);
> +	int error;

This variable is not necessary.

>  
>  	if (device_may_wakeup(dev))
> -		enable_irq_wake(priv->irq);
> +		error = enable_irq_wake(priv->irq);
> +
> +	if (error) {
> +		dev_err(dev,
> +			"failed to enable irq wake on IRQ %d: %d\n",
> +			priv->irq, error);

Please remove this message, this is too verbose and there is no action
for the user apart from trying to go to suspend again.

> +		return error;
> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.25.1
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ