All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: cd-gpio: allow NULL context in mmc_cd_gpio_free()
@ 2012-04-24 15:56 Guennadi Liakhovetski
  2012-04-24 16:22 ` Chris Ball
  0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2012-04-24 15:56 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball

Do not Oops, even if mmc_cd_gpio_free() is mistakenly called on a
driver-cleanup path, even though a previous call to mmc_cd_gpio_request()
failed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---

Hi Chris

Unfortunately, as I submitted the final version of the original cd-gpio 
patch http://article.gmane.org/gmane.linux.kernel.mmc/12013 I forgot, that 
I'd already sent a v2 and hadn't incremented the version to v3. And that 
version contained the below fix, that went lost because of the wrong 
version number. So, please, push this incremental fix for 3.4, because 
otherwise some error-paths of the tmio-mmc driver can Oops.

 drivers/mmc/core/cd-gpio.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c
index 29de31e..56b854d 100644
--- a/drivers/mmc/core/cd-gpio.c
+++ b/drivers/mmc/core/cd-gpio.c
@@ -72,6 +72,9 @@ void mmc_cd_gpio_free(struct mmc_host *host)
 {
 	struct mmc_cd_gpio *cd = host->hotplug.handler_priv;
 
+	if (!cd)
+		return;
+
 	free_irq(host->hotplug.irq, host);
 	gpio_free(cd->gpio);
 	kfree(cd);
-- 
1.7.2.5


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

end of thread, other threads:[~2012-04-24 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24 15:56 [PATCH] mmc: cd-gpio: allow NULL context in mmc_cd_gpio_free() Guennadi Liakhovetski
2012-04-24 16:22 ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.