5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anfernee Cao commit 2d8927fadbf95e2d2dfa95bcc73882d6e19c2ce4 upstream. mmci_probe() calls mmci_dma_setup(), which acquires the RX and TX DMA channels via dma_request_chan(). These channels are not managed by devres, and are released only by mmci_dma_release(). If the following mmc_add_host() fails, probe jumps to the clk_disable label, which only disables the clock. As probe then fails, mmci_remove() is never called, so both DMA channels are leaked. Release them by adding a dedicated unwind label, reached only after mmci_dma_setup(). This issue was found by manual code inspection. Fixes: b38a20f29a49 ("mmc: mmci: fix return value check of mmc_add_host()") Cc: stable@vger.kernel.org Signed-off-by: Anfernee Cao Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/mmci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -2257,11 +2257,13 @@ static int mmci_probe(struct amba_device ret = mmc_add_host(mmc); if (ret) - goto clk_disable; + goto dma_release; pm_runtime_put(&dev->dev); return 0; +dma_release: + mmci_dma_release(host); clk_disable: clk_disable_unprepare(host->clk); host_free: