summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2019-01-19 18:31:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-06 19:30:13 +0300
commit65be3226f0e5a266e78cf534dff24c8301289b0e (patch)
tree65f7945b2794bf400f20f5cc91a6bec9c159a3aa /drivers
parent8b9be9db8a2ac5ec2046cc95df35487e5aaa136c (diff)
downloadlinux-65be3226f0e5a266e78cf534dff24c8301289b0e.tar.xz
mmc: bcm2835: Fix DMA channel leak on probe error
commit 8c9620b1cc9b69e82fa8d4081d646d0016b602e7 upstream. 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: 660fc733bd74 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/bcm2835.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 768972af8b85..0d3b7473bc21 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -1427,6 +1427,8 @@ static int bcm2835_probe(struct platform_device *pdev)
err:
dev_dbg(dev, "%s -> err %d\n", __func__, ret);
+ if (host->dma_chan_rxtx)
+ dma_release_channel(host->dma_chan_rxtx);
mmc_free_host(mmc);
return ret;