Skip to content

Commit

Permalink
bcm2835-mmc: Handle mmc_add_host() errors
Browse files Browse the repository at this point in the history
The BCM2835 MMC host driver calls mmc_add_host() but doesn't check its
return value.  Errors occurring in that function are therefore not
handled.  Fix it.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
  • Loading branch information
l1k authored and Phil Elwell committed Mar 26, 2019
1 parent 9fce945 commit a3e27f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/mmc/host/bcm2835-mmc.c
Expand Up @@ -1398,10 +1398,16 @@ static int bcm2835_mmc_add_host(struct bcm2835_host *host)
}

mmiowb();
mmc_add_host(mmc);
ret = mmc_add_host(mmc);
if (ret) {
dev_err(dev, "could not add MMC host\n");
goto free_irq;
}

return 0;

free_irq:
free_irq(host->irq, host);
untasklet:
tasklet_kill(&host->finish_tasklet);

Expand Down

0 comments on commit a3e27f3

Please sign in to comment.