diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 1708818549752fe2dcb3f52e704e6651636e0767..3f8c85d5aa094b43666904c7dbbe5e62c9763c19 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -371,6 +371,8 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) if (mmc_gpio_alloc(host)) { put_device(&host->class_dev); + ida_simple_remove(&mmc_host_ida, host->index); + kfree(host); return NULL; }