aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/cd-gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/cd-gpio.c')
-rw-r--r--drivers/mmc/core/cd-gpio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mmc/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c
index 2c14be73254c..f13e38deceac 100644
--- 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);