Message ID | 1413922153-24797-1-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index f3b2d8c..51add7f 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -1042,6 +1042,15 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host, } /* + * Check the sanity of mmc->f_min to prevent tmio_mmc_set_clock() from + * looping forever... + */ + if (mmc->f_min == 0) { + ret = -EINVAL; + goto host_free; + } + + /* * There are 4 different scenarios for the card detection: * 1) an external gpio irq handles the cd (best for power savings) * 2) internal sdhi irq handles the cd