]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 22 Sep 2022 19:06:40 +0000 (21:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:22:30 +0000 (13:22 +0200)
[ Upstream commit 9df3ab9edd5c3589816b5f02d4d2d3fc97e1c272 ]

A dma_free_coherent() call is missing in the error handling path of the
probe, as already done in the remove function.

Fixes: fc37cbe8cbb4 ("mmc: SD/MMC Host Controller for Wondermedia WM8505/WM8650")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/53fc6ffa5d1c428fefeae7d313cf4a669c3a1e98.1663873255.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/wmt-sdmmc.c

index 2c4ba1fa4bbfdbe056e77c2d8300acb5d75cf19e..d774068dba30d004d6cf4dc58e51cced254eac7f 100644 (file)
@@ -849,7 +849,7 @@ static int wmt_mci_probe(struct platform_device *pdev)
        if (IS_ERR(priv->clk_sdmmc)) {
                dev_err(&pdev->dev, "Error getting clock\n");
                ret = PTR_ERR(priv->clk_sdmmc);
-               goto fail5;
+               goto fail5_and_a_half;
        }
 
        ret = clk_prepare_enable(priv->clk_sdmmc);
@@ -866,6 +866,9 @@ static int wmt_mci_probe(struct platform_device *pdev)
        return 0;
 fail6:
        clk_put(priv->clk_sdmmc);
+fail5_and_a_half:
+       dma_free_coherent(&pdev->dev, mmc->max_blk_count * 16,
+                         priv->dma_desc_buffer, priv->dma_desc_device_addr);
 fail5:
        free_irq(dma_irq, priv);
 fail4: