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: <643e844b-2640-e2c8-d8a7-1cd91d453ccc@intel.com>
Date:   Thu, 3 Aug 2023 08:46:08 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Yangtao Li <frank.li@...o.com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>
Cc:     Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
        linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 62/62] mmc: f-sdh30: fix order of function calls in
 sdhci_f_sdh30_remove

On 27/07/23 16:55, Adrian Hunter wrote:
> On 27/07/23 10:00, Yangtao Li wrote:
>> The order of function calls in sdhci_f_sdh30_remove is wrong,
>> let's call sdhci_pltfm_unregister first.
>>
>> Cc: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
>> Fixes: 5def5c1c15bf ("mmc: sdhci-f-sdh30: Replace with sdhci_pltfm")
>> Signed-off-by: Yangtao Li <frank.li@...o.com>
>> ---
>>  drivers/mmc/host/sdhci_f_sdh30.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
>> index 840084ee72e6..964fa18a61a4 100644
>> --- a/drivers/mmc/host/sdhci_f_sdh30.c
>> +++ b/drivers/mmc/host/sdhci_f_sdh30.c
>> @@ -211,11 +211,11 @@ static void sdhci_f_sdh30_remove(struct platform_device *pdev)
>>  	struct sdhci_host *host = platform_get_drvdata(pdev);
>>  	struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
>>  
>> +	sdhci_pltfm_unregister(pdev);
> 
> That also frees priv
> 
>> +
>>  	reset_control_assert(priv->rst);
>>  	clk_disable_unprepare(priv->clk);
>>  	clk_disable_unprepare(priv->clk_iface);
>> -
>> -	sdhci_pltfm_unregister(pdev);
>>  }
>>  
>>  #ifdef CONFIG_OF
> 

So it needs to end up looking something like below, right?

diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
index 840084ee72e6..47ae853f51aa 100644
--- a/drivers/mmc/host/sdhci_f_sdh30.c
+++ b/drivers/mmc/host/sdhci_f_sdh30.c
@@ -210,12 +210,15 @@ static void sdhci_f_sdh30_remove(struct platform_device *pdev)
 {
 	struct sdhci_host *host = platform_get_drvdata(pdev);
 	struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
-
-	reset_control_assert(priv->rst);
-	clk_disable_unprepare(priv->clk);
-	clk_disable_unprepare(priv->clk_iface);
+	struct clk *clk_iface = priv->clk_iface;
+	struct reset_control *rst = priv->rst;
+	struct clk *clk = priv->clk;
 
 	sdhci_pltfm_unregister(pdev);
+
+	reset_control_assert(rst);
+	clk_disable_unprepare(clk);
+	clk_disable_unprepare(clk_iface);
 }
 
 #ifdef CONFIG_OF

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ