mmc: core: fix error path in mmc_host_alloc
Properly reverse everything if mmc_gpio_alloc(host) fails. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
7413d1f509
commit
1ed2171944
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue