public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-tegra: free irq on error and remove
@ 2011-02-10 17:07 Wolfram Sang
  2011-02-21  7:21 ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2011-02-10 17:07 UTC (permalink / raw)
  To: linux-mmc; +Cc: Wolfram Sang, Olof Johansson, Chris Ball

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Olof Johansson <olof@lixom.net>
Cc: Chris Ball <cjb@laptop.org>
---

Found the leak while working on the esdhc-imx driver. Not even compile tested,
please check.

 drivers/mmc/host/sdhci-tegra.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 4823ee9..f7e1f96 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -169,7 +169,7 @@ static int tegra_sdhci_pltfm_init(struct sdhci_host *host,
 		if (rc) {
 			dev_err(mmc_dev(host->mmc),
 				"failed to allocate wp gpio\n");
-			goto out_cd;
+			goto out_irq;
 		}
 		tegra_gpio_enable(plat->wp_gpio);
 		gpio_direction_input(plat->wp_gpio);
@@ -195,6 +195,9 @@ out_wp:
 		gpio_free(plat->wp_gpio);
 	}
 
+out_irq:
+	if (gpio_is_valid(plat->cd_gpio))
+		free_irq(gpio_to_irq(plat->cd_gpio), host);
 out_cd:
 	if (gpio_is_valid(plat->cd_gpio)) {
 		tegra_gpio_disable(plat->cd_gpio);
@@ -225,6 +228,7 @@ static void tegra_sdhci_pltfm_exit(struct sdhci_host *host)
 	}
 
 	if (gpio_is_valid(plat->cd_gpio)) {
+		free_irq(gpio_to_irq(plat->cd_gpio), host);
 		tegra_gpio_disable(plat->cd_gpio);
 		gpio_free(plat->cd_gpio);
 	}
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: sdhci-tegra: free irq on error and remove
  2011-02-10 17:07 [PATCH] mmc: sdhci-tegra: free irq on error and remove Wolfram Sang
@ 2011-02-21  7:21 ` Wolfram Sang
  2011-02-21 21:35   ` Olof Johansson
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2011-02-21  7:21 UTC (permalink / raw)
  To: linux-mmc; +Cc: Olof Johansson, Chris Ball

[-- Attachment #1: Type: text/plain, Size: 1675 bytes --]

On Thu, Feb 10, 2011 at 06:07:30PM +0100, Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Olof Johansson <olof@lixom.net>
> Cc: Chris Ball <cjb@laptop.org>
> ---
> 
> Found the leak while working on the esdhc-imx driver. Not even compile tested,
> please check.

Olof, do you have a minute for this one?

> 
>  drivers/mmc/host/sdhci-tegra.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> index 4823ee9..f7e1f96 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -169,7 +169,7 @@ static int tegra_sdhci_pltfm_init(struct sdhci_host *host,
>  		if (rc) {
>  			dev_err(mmc_dev(host->mmc),
>  				"failed to allocate wp gpio\n");
> -			goto out_cd;
> +			goto out_irq;
>  		}
>  		tegra_gpio_enable(plat->wp_gpio);
>  		gpio_direction_input(plat->wp_gpio);
> @@ -195,6 +195,9 @@ out_wp:
>  		gpio_free(plat->wp_gpio);
>  	}
>  
> +out_irq:
> +	if (gpio_is_valid(plat->cd_gpio))
> +		free_irq(gpio_to_irq(plat->cd_gpio), host);
>  out_cd:
>  	if (gpio_is_valid(plat->cd_gpio)) {
>  		tegra_gpio_disable(plat->cd_gpio);
> @@ -225,6 +228,7 @@ static void tegra_sdhci_pltfm_exit(struct sdhci_host *host)
>  	}
>  
>  	if (gpio_is_valid(plat->cd_gpio)) {
> +		free_irq(gpio_to_irq(plat->cd_gpio), host);
>  		tegra_gpio_disable(plat->cd_gpio);
>  		gpio_free(plat->cd_gpio);
>  	}
> -- 
> 1.7.2.3
> 

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: sdhci-tegra: free irq on error and remove
  2011-02-21  7:21 ` Wolfram Sang
@ 2011-02-21 21:35   ` Olof Johansson
  2011-02-21 21:44     ` Chris Ball
  0 siblings, 1 reply; 4+ messages in thread
From: Olof Johansson @ 2011-02-21 21:35 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-mmc, Chris Ball

On Sun, Feb 20, 2011 at 11:21 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> On Thu, Feb 10, 2011 at 06:07:30PM +0100, Wolfram Sang wrote:
>> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
>> Cc: Olof Johansson <olof@lixom.net>
>> Cc: Chris Ball <cjb@laptop.org>
>> ---
>>
>> Found the leak while working on the esdhc-imx driver. Not even compile tested,
>> please check.
>
> Olof, do you have a minute for this one?

Yeah, my bad -- I thought I had already acked it.

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: sdhci-tegra: free irq on error and remove
  2011-02-21 21:35   ` Olof Johansson
@ 2011-02-21 21:44     ` Chris Ball
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Ball @ 2011-02-21 21:44 UTC (permalink / raw)
  To: Olof Johansson; +Cc: Wolfram Sang, linux-mmc

Hi,

On Mon, Feb 21, 2011 at 01:35:36PM -0800, Olof Johansson wrote:
> >> Found the leak while working on the esdhc-imx driver. Not even compile tested,
> >> please check.
> >
> > Olof, do you have a minute for this one?
> 
> Yeah, my bad -- I thought I had already acked it.
> 
> Acked-by: Olof Johansson <olof@lixom.net>

Thanks, pushed to mmc-next for .39.

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-21 21:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-10 17:07 [PATCH] mmc: sdhci-tegra: free irq on error and remove Wolfram Sang
2011-02-21  7:21 ` Wolfram Sang
2011-02-21 21:35   ` Olof Johansson
2011-02-21 21:44     ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox