Commit 1ed21719 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Ulf Hansson

mmc: core: fix error path in mmc_host_alloc

Properly reverse everything if mmc_gpio_alloc(host) fails.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 7413d1f5
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment