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

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