# \[PATCH 2/2\] mmc: uniphier-sd: Fix a resource leak in the remove function

- Subsystems: ARM/UNIPHIER ARCHITECTURE, MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM, THE REST
- Maintainers: Kunihiko Hayashi, Masami Hiramatsu, Ulf Hansson, Linus Torvalds
- Status: LANDED (e29c84857e2d · 2021-03-30 09:41)
- Landed in mainline as e29c84857e2d on 2021-03-30.
- List: linux-arm-kernel
- 3 messages, 3 authors
- Page: https://ratatoskr.run/linux-arm-kernel/2021/02/6274401/t

## \[PATCH 2/2\] mmc: uniphier-sd: Fix a resource leak in the remove function

- From: Christophe JAILLET \<hidden\>
- Date: 2021-02-20 14:32:03 
- Message: https://ratatoskr.run/linux-arm-kernel/2021/02/6274401.md

```text
A 'tmio_mmc_host_free()' call is missing in the remove function, in order
to balance a 'tmio_mmc_host_alloc()' call in the probe.
This is done in the error handling path of the probe, but not in the remove
function.

Add the missing call.

Fixes: 3fd784f745dd ("mmc: uniphier-sd: add UniPhier SD/eMMC controller driver")
Signed-off-by: Christophe JAILLET <redacted>
---
 drivers/mmc/host/uniphier-sd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c
index 6f0f05466917..ccbf9885a52b 100644
--- a/drivers/mmc/host/uniphier-sd.c
+++ b/drivers/mmc/host/uniphier-sd.c
@@ -660,6 +660,7 @@ static int uniphier_sd_remove(struct platform_device *pdev)
 
 	tmio_mmc_host_remove(host);
 	uniphier_sd_clk_disable(host);
+	tmio_mmc_host_free(host);
 
 	return 0;
 }
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```

## Re: \[PATCH 2/2\] mmc: uniphier-sd: Fix a resource leak in the remove function

- From: Masahiro Yamada \<masahiroy@kernel.org\>
- Date: 2021-02-22 11:49:00 
- Message: https://ratatoskr.run/linux-arm-kernel/2021/02/6275301.md

```text
On Sat, Feb 20, 2021 at 11:31 PM Christophe JAILLET
[ref] wrote:
>
> A 'tmio_mmc_host_free()' call is missing in the remove function, in order
> to balance a 'tmio_mmc_host_alloc()' call in the probe.
> This is done in the error handling path of the probe, but not in the remove
> function.
>
> Add the missing call.
>
> Fixes: 3fd784f745dd ("mmc: uniphier-sd: add UniPhier SD/eMMC controller driver")
> Signed-off-by: Christophe JAILLET <redacted>


Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>


> ---
>  drivers/mmc/host/uniphier-sd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c
> index 6f0f05466917..ccbf9885a52b 100644
> --- a/drivers/mmc/host/uniphier-sd.c
> +++ b/drivers/mmc/host/uniphier-sd.c
> @@ -660,6 +660,7 @@ static int uniphier_sd_remove(struct platform_device *pdev)
>
>         tmio_mmc_host_remove(host);
>         uniphier_sd_clk_disable(host);
> +       tmio_mmc_host_free(host);
>
>         return 0;
>  }
> --
> 2.27.0
>


-- 
Best Regards
Masahiro Yamada

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```

## Re: \[PATCH 2/2\] mmc: uniphier-sd: Fix a resource leak in the remove function

- From: Ulf Hansson \<hidden\>
- Date: 2021-03-02 11:02:25 
- Message: https://ratatoskr.run/linux-arm-kernel/2021/03/6285093.md

```text
On Sat, 20 Feb 2021 at 15:29, Christophe JAILLET
[ref] wrote:
>
> A 'tmio_mmc_host_free()' call is missing in the remove function, in order
> to balance a 'tmio_mmc_host_alloc()' call in the probe.
> This is done in the error handling path of the probe, but not in the remove
> function.
>
> Add the missing call.
>
> Fixes: 3fd784f745dd ("mmc: uniphier-sd: add UniPhier SD/eMMC controller driver")
> Signed-off-by: Christophe JAILLET <redacted>

Applied for next and by adding a stable tag, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/uniphier-sd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c
> index 6f0f05466917..ccbf9885a52b 100644
> --- a/drivers/mmc/host/uniphier-sd.c
> +++ b/drivers/mmc/host/uniphier-sd.c
> @@ -660,6 +660,7 @@ static int uniphier_sd_remove(struct platform_device *pdev)
>
>         tmio_mmc_host_remove(host);
>         uniphier_sd_clk_disable(host);
> +       tmio_mmc_host_free(host);
>
>         return 0;
>  }
> --
> 2.27.0
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
