projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0dd1bfe
)
mmc: cd-gpio: protect against NULL context in mmc_cd_gpio_free()
author
Guennadi Liakhovetski
<g.liakhovetski@gmx.de>
Tue, 24 Apr 2012 15:56:29 +0000
(17:56 +0200)
committer
Chris Ball
<cjb@laptop.org>
Tue, 24 Apr 2012 16:21:22 +0000
(12:21 -0400)
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>
[stable@: please apply to 3.3-stable]
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/cd-gpio.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mmc/core/cd-gpio.c
b/drivers/mmc/core/cd-gpio.c
index 2c14be73254c385d9a481c89db978c7c82c1b6e9..f13e38deceac760fcbd9ae4cd2a1fdf7e5d79671 100644
(file)
--- a/
drivers/mmc/core/cd-gpio.c
+++ b/
drivers/mmc/core/cd-gpio.c
@@
-73,6
+73,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);