mirror of
https://github.com/torvalds/linux.git
synced 2024-12-14 23:25:54 +00:00
mmc: dw_mmc: Don't crash if we get an interrupt before slot has initted
It's unlikely that this is really needed on any single-slot systems where we disable card detects until the end of probe, but it still seems safer to check to make sure that a slot has been initted before we try to dereference it to find the SDIO interrupt mask. Signed-off-by: Doug Anderson <dianders@chromium.org> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
fa0c328343
commit
ed2540effa
@ -2217,6 +2217,10 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
|
||||
/* Handle SDIO Interrupts */
|
||||
for (i = 0; i < host->num_slots; i++) {
|
||||
struct dw_mci_slot *slot = host->slot[i];
|
||||
|
||||
if (!slot)
|
||||
continue;
|
||||
|
||||
if (pending & SDMMC_INT_SDIO(slot->sdio_id)) {
|
||||
mci_writel(host, RINTSTS,
|
||||
SDMMC_INT_SDIO(slot->sdio_id));
|
||||
|
Loading…
Reference in New Issue
Block a user