diff mbox series

mmc: mxs-mmc: Fix a resource leak in an error handling path in 'mxs_mmc_probe()'

Message ID 20201208203527.49262-1-christophe.jaillet@wanadoo.fr
State New
Headers show
Series mmc: mxs-mmc: Fix a resource leak in an error handling path in 'mxs_mmc_probe()' | expand

Commit Message

Christophe JAILLET Dec. 8, 2020, 8:35 p.m. UTC
If 'mmc_of_parse()' fails, we must undo the previous 'dma_request_chan()'
call.

Fixes: abd37cccd47f ("mmc: mxs: use mmc_gpio_get_ro for detecting read-only status")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
I'm not 100% sure of the Fixes tag, but it seems to be the root cause. The
erroneous 'out_clk_disable' has then been kept around in the following
commits
---
 drivers/mmc/host/mxs-mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ulf Hansson Jan. 11, 2021, 6:05 p.m. UTC | #1
On Tue, 8 Dec 2020 at 21:35, Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>

> If 'mmc_of_parse()' fails, we must undo the previous 'dma_request_chan()'

> call.

>

> Fixes: abd37cccd47f ("mmc: mxs: use mmc_gpio_get_ro for detecting read-only status")

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>


Applied for next (by dropping the fixes tag as it seems non-critical
anyway), thanks!

Kind regards
Uffe



> ---

> I'm not 100% sure of the Fixes tag, but it seems to be the root cause. The

> erroneous 'out_clk_disable' has then been kept around in the following

> commits

> ---

>  drivers/mmc/host/mxs-mmc.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c

> index 56bbc6cd9c84..947581de7860 100644

> --- a/drivers/mmc/host/mxs-mmc.c

> +++ b/drivers/mmc/host/mxs-mmc.c

> @@ -628,7 +628,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)

>

>         ret = mmc_of_parse(mmc);

>         if (ret)

> -               goto out_clk_disable;

> +               goto out_free_dma;

>

>         mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;

>

> --

> 2.27.0

>
diff mbox series

Patch

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 56bbc6cd9c84..947581de7860 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -628,7 +628,7 @@  static int mxs_mmc_probe(struct platform_device *pdev)
 
 	ret = mmc_of_parse(mmc);
 	if (ret)
-		goto out_clk_disable;
+		goto out_free_dma;
 
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;