* [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
* Re: [PATCH] mmc: cd-gpio: allow NULL context in mmc_cd_gpio_free()
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
0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2012-04-24 16:22 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-mmc
Hi Guennadi,
On Tue, Apr 24 2012, Guennadi Liakhovetski wrote:
> 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.
Sorry about that, I should have noticed this as well.
Pushed to mmc-next for 3.4 with a stable@ tag for 3.3. (It's helpful if
you can add the stable@ tag yourself when submitting.)
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).