mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
mmc: core: fix error path in mmc_host_alloc
Properly reverse everything if mmc_gpio_alloc(host) fails. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
This commit is contained in:
parent
7413d1f509
commit
1ed2171944
1 changed files with 2 additions and 0 deletions
|
|
@ -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 a new issue