public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: linux-mmc@vger.kernel.org
Cc: Olof Johansson <olof@lixom.net>, Chris Ball <cjb@laptop.org>
Subject: Re: [PATCH] mmc: sdhci-tegra: free irq on error and remove
Date: Mon, 21 Feb 2011 08:21:20 +0100	[thread overview]
Message-ID: <20110221072120.GA13424@pengutronix.de> (raw)
In-Reply-To: <1297357650-14245-1-git-send-email-w.sang@pengutronix.de>

[-- 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 --]

  reply	other threads:[~2011-02-21  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10 17:07 [PATCH] mmc: sdhci-tegra: free irq on error and remove Wolfram Sang
2011-02-21  7:21 ` Wolfram Sang [this message]
2011-02-21 21:35   ` Olof Johansson
2011-02-21 21:44     ` Chris Ball

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110221072120.GA13424@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=olof@lixom.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox