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]
Message-ID: <f47dcc9f-408d-baf3-a08e-e2d02014b61e@intel.com>
Date:   Thu, 27 Jul 2023 16:56:39 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Yangtao Li <frank.li@...o.com>,
        Ulf Hansson <ulf.hansson@...aro.org>
Cc:     Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
        linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 59/62] mmc: sdhci_am654: Properly handle failures in
 .remove()

On 27/07/23 10:00, Yangtao Li wrote:
> Returning an error code in a platform driver's remove function is wrong
> most of the time and there is an effort to make the callback return
> void. To prepare this rework the function not to exit early.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> Signed-off-by: Yangtao Li <frank.li@...o.com>

Acked-by: Adrian Hunter <adrian.hunter@...el.com>

> ---
>  drivers/mmc/host/sdhci_am654.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c
> index 7cdf0f54e3a5..1cc84739ef2f 100644
> --- a/drivers/mmc/host/sdhci_am654.c
> +++ b/drivers/mmc/host/sdhci_am654.c
> @@ -870,16 +870,17 @@ static int sdhci_am654_remove(struct platform_device *pdev)
>  {
>  	struct sdhci_host *host = platform_get_drvdata(pdev);
>  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +	struct device *dev = &pdev->dev;
>  	int ret;
>  
> -	ret = pm_runtime_resume_and_get(&pdev->dev);
> +	ret = pm_runtime_get_sync(dev);
>  	if (ret < 0)
> -		return ret;
> +		dev_err(dev, "pm_runtime_get_sync() Failed\n");
>  
>  	sdhci_remove_host(host, true);
>  	clk_disable_unprepare(pltfm_host->clk);
> -	pm_runtime_disable(&pdev->dev);
> -	pm_runtime_put_noidle(&pdev->dev);
> +	pm_runtime_disable(dev);
> +	pm_runtime_put_noidle(dev);
>  	sdhci_pltfm_free(pdev);
>  	return 0;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ