kernel/drivers/mmc/host/wbsd.c
.. .. @@ -1703,7 +1703,15 @@ 1703 1703 */ 1704 1704 wbsd_init_device(host); 1705 1705 1706 - mmc_add_host(mmc);1706 + ret = mmc_add_host(mmc);1707 + if (ret) {1708 + if (!pnp)1709 + wbsd_chip_poweroff(host);1710 +1711 + wbsd_release_resources(host);1712 + wbsd_free_mmc(dev);1713 + return ret;1714 + }1707 1715 1708 1716 pr_info("%s: W83L51xD", mmc_hostname(mmc)); 1709 1717 if (host->chip_id != 0)