Skip to content

Commit

Permalink
bcm2835-mmc: Fix struct mmc_host leak on probe
Browse files Browse the repository at this point in the history
The BCM2835 MMC host driver requests the bus address of the host's
register map on probe.  If that fails, the driver leaks the struct
mmc_host allocated earlier.

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 0168e0d commit e5c5663
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mmc/host/bcm2835-mmc.c
Expand Up @@ -1439,7 +1439,8 @@ static int bcm2835_mmc_probe(struct platform_device *pdev)
addr = of_get_address(node, 0, NULL, NULL);
if (!addr) {
dev_err(dev, "could not get DMA-register address\n");
return -ENODEV;
ret = -ENODEV;
goto err;
}
host->bus_addr = be32_to_cpup(addr);
pr_debug(" - ioaddr %lx, iomem->start %lx, bus_addr %lx\n",
Expand Down

0 comments on commit e5c5663

Please sign in to comment.