linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe
  2020-11-12  9:25 [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe Zheng Liang
@ 2020-11-12  8:51 ` Chaotian Jing
  2020-11-17 11:50 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Chaotian Jing @ 2020-11-12  8:51 UTC (permalink / raw)
  To: Zheng Liang
  Cc: ulf.hansson, wenbin.mei, linux-mmc, linux-mediatek, fangwei1,
	matthias.bgg, wangli74, linux-arm-kernel

On Thu, 2020-11-12 at 17:25 +0800, Zheng Liang wrote:
> It should use mmc_free_host to free mem in error patch of
> msdc_drv_probe.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zheng Liang <zhengliang6@huawei.com>
Reviewed-by: Chaotian Jing <chaotian.jing@mediatek.com>
> ---
>  drivers/mmc/host/mtk-sd.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index fc5ee5df91ad..eac7838e2dac 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2504,8 +2504,10 @@ static int msdc_drv_probe(struct platform_device *pdev)
>  
>  	host->reset = devm_reset_control_get_optional_exclusive(&pdev->dev,
>  								"hrst");
> -	if (IS_ERR(host->reset))
> -		return PTR_ERR(host->reset);
> +	if (IS_ERR(host->reset)) {
> +		ret = PTR_ERR(host->reset);
> +		goto host_free;
> +	}
>  
>  	host->irq = platform_get_irq(pdev, 0);
>  	if (host->irq < 0) {

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe
@ 2020-11-12  9:25 Zheng Liang
  2020-11-12  8:51 ` Chaotian Jing
  2020-11-17 11:50 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Zheng Liang @ 2020-11-12  9:25 UTC (permalink / raw)
  To: chaotian.jing, ulf.hansson
  Cc: linux-mmc, linux-mediatek, fangwei1, matthias.bgg, wangli74,
	linux-arm-kernel

It should use mmc_free_host to free mem in error patch of
msdc_drv_probe.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Liang <zhengliang6@huawei.com>
---
 drivers/mmc/host/mtk-sd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index fc5ee5df91ad..eac7838e2dac 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -2504,8 +2504,10 @@ static int msdc_drv_probe(struct platform_device *pdev)
 
 	host->reset = devm_reset_control_get_optional_exclusive(&pdev->dev,
 								"hrst");
-	if (IS_ERR(host->reset))
-		return PTR_ERR(host->reset);
+	if (IS_ERR(host->reset)) {
+		ret = PTR_ERR(host->reset);
+		goto host_free;
+	}
 
 	host->irq = platform_get_irq(pdev, 0);
 	if (host->irq < 0) {
-- 
2.17.1


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe
  2020-11-12  9:25 [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe Zheng Liang
  2020-11-12  8:51 ` Chaotian Jing
@ 2020-11-17 11:50 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-11-17 11:50 UTC (permalink / raw)
  To: Zheng Liang
  Cc: linux-mmc@vger.kernel.org,
	moderated list:ARM/Mediatek SoC support, Chaotian Jing,
	Matthias Brugger, wangli74, Linux ARM, fangwei1

On Thu, 12 Nov 2020 at 09:27, Zheng Liang <zhengliang6@huawei.com> wrote:
>
> It should use mmc_free_host to free mem in error patch of
> msdc_drv_probe.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zheng Liang <zhengliang6@huawei.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mtk-sd.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index fc5ee5df91ad..eac7838e2dac 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2504,8 +2504,10 @@ static int msdc_drv_probe(struct platform_device *pdev)
>
>         host->reset = devm_reset_control_get_optional_exclusive(&pdev->dev,
>                                                                 "hrst");
> -       if (IS_ERR(host->reset))
> -               return PTR_ERR(host->reset);
> +       if (IS_ERR(host->reset)) {
> +               ret = PTR_ERR(host->reset);
> +               goto host_free;
> +       }
>
>         host->irq = platform_get_irq(pdev, 0);
>         if (host->irq < 0) {
> --
> 2.17.1
>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-17 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-12  9:25 [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe Zheng Liang
2020-11-12  8:51 ` Chaotian Jing
2020-11-17 11:50 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).