All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liang <zhengliang6@huawei.com>
To: <chaotian.jing@mediatek.com>, <ulf.hansson@linaro.org>
Cc: <matthias.bgg@gmail.com>, <linux-mmc@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>, <wangli74@huawei.com>,
	<fangwei1@huawei.com>
Subject: [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe
Date: Thu, 12 Nov 2020 17:25:30 +0800	[thread overview]
Message-ID: <20201112092530.32446-1-zhengliang6@huawei.com> (raw)

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


WARNING: multiple messages have this Message-ID (diff)
From: Zheng Liang <zhengliang6@huawei.com>
To: <chaotian.jing@mediatek.com>, <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, linux-mediatek@lists.infradead.org,
	fangwei1@huawei.com, matthias.bgg@gmail.com, wangli74@huawei.com,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe
Date: Thu, 12 Nov 2020 17:25:30 +0800	[thread overview]
Message-ID: <20201112092530.32446-1-zhengliang6@huawei.com> (raw)

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-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Zheng Liang <zhengliang6@huawei.com>
To: <chaotian.jing@mediatek.com>, <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, linux-mediatek@lists.infradead.org,
	fangwei1@huawei.com, matthias.bgg@gmail.com, wangli74@huawei.com,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe
Date: Thu, 12 Nov 2020 17:25:30 +0800	[thread overview]
Message-ID: <20201112092530.32446-1-zhengliang6@huawei.com> (raw)

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

             reply	other threads:[~2020-11-12  8:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12  9:25 Zheng Liang [this message]
2020-11-12  9:25 ` [PATCH] mmc: mediatek: fix mem leak in msdc_drv_probe Zheng Liang
2020-11-12  9:25 ` Zheng Liang
2020-11-12  8:51 ` Chaotian Jing
2020-11-12  8:51   ` Chaotian Jing
2020-11-12  8:51   ` Chaotian Jing
2020-11-17 11:50 ` Ulf Hansson
2020-11-17 11:50   ` Ulf Hansson
2020-11-17 11:50   ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201112092530.32446-1-zhengliang6@huawei.com \
    --to=zhengliang6@huawei.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=fangwei1@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wangli74@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.