Skip to content

Commit 8c9620b

Browse files
l1kstorulf
authored andcommitted
mmc: bcm2835: Fix DMA channel leak on probe error
The BCM2835 MMC host driver requests a DMA channel on probe but neglects to release the channel in the probe error path. The channel may therefore be leaked, in particular if devm_clk_get() causes probe deferral. Fix it. Fixes: 660fc73 ("mmc: bcm2835: Add new driver for the sdhost controller.") Signed-off-by: Lukas Wunner <lukas@wunner.de> Cc: stable@vger.kernel.org # v4.12+ Cc: Frank Pavlic <f.pavlic@kunbus.de> Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent f17b5f0 commit 8c9620b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/mmc/host/bcm2835.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,8 @@ static int bcm2835_probe(struct platform_device *pdev)
14311431

14321432
err:
14331433
dev_dbg(dev, "%s -> err %d\n", __func__, ret);
1434+
if (host->dma_chan_rxtx)
1435+
dma_release_channel(host->dma_chan_rxtx);
14341436
mmc_free_host(mmc);
14351437

14361438
return ret;

0 commit comments

Comments
 (0)