stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] mmc: sdhci-of-at91: fix memleak on clk_get failure" failed to apply to 5.5-stable tree
@ 2020-02-06 19:08 gregkh
  2020-02-07  1:09 ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2020-02-06 19:08 UTC (permalink / raw)
  To: mirq-linux, adrian.hunter, ludovic.desroches, stable, ulf.hansson; +Cc: stable


The patch below does not apply to the 5.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From a04184ce777b46e92c2b3c93c6dcb2754cb005e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <mirq-linux@rere.qmqm.pl>
Date: Thu, 2 Jan 2020 11:42:16 +0100
Subject: [PATCH] mmc: sdhci-of-at91: fix memleak on clk_get failure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

sdhci_alloc_host() does its work not using managed infrastructure, so
needs explicit free on error path. Add it where needed.

Cc: <stable@vger.kernel.org>
Fixes: bb5f8ea4d514 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/b2a44d5be2e06ff075f32477e466598bb0f07b36.1577961679.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
index b2a8c45c9c23..ab2bd314a390 100644
--- a/drivers/mmc/host/sdhci-of-at91.c
+++ b/drivers/mmc/host/sdhci-of-at91.c
@@ -345,20 +345,23 @@ static int sdhci_at91_probe(struct platform_device *pdev)
 			priv->mainck = NULL;
 		} else {
 			dev_err(&pdev->dev, "failed to get baseclk\n");
-			return PTR_ERR(priv->mainck);
+			ret = PTR_ERR(priv->mainck);
+			goto sdhci_pltfm_free;
 		}
 	}
 
 	priv->hclock = devm_clk_get(&pdev->dev, "hclock");
 	if (IS_ERR(priv->hclock)) {
 		dev_err(&pdev->dev, "failed to get hclock\n");
-		return PTR_ERR(priv->hclock);
+		ret = PTR_ERR(priv->hclock);
+		goto sdhci_pltfm_free;
 	}
 
 	priv->gck = devm_clk_get(&pdev->dev, "multclk");
 	if (IS_ERR(priv->gck)) {
 		dev_err(&pdev->dev, "failed to get multclk\n");
-		return PTR_ERR(priv->gck);
+		ret = PTR_ERR(priv->gck);
+		goto sdhci_pltfm_free;
 	}
 
 	ret = sdhci_at91_set_clks_presets(&pdev->dev);


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

* Re: FAILED: patch "[PATCH] mmc: sdhci-of-at91: fix memleak on clk_get failure" failed to apply to 5.5-stable tree
  2020-02-06 19:08 FAILED: patch "[PATCH] mmc: sdhci-of-at91: fix memleak on clk_get failure" failed to apply to 5.5-stable tree gregkh
@ 2020-02-07  1:09 ` Sasha Levin
  2020-02-11  6:21   ` Ludovic Desroches
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2020-02-07  1:09 UTC (permalink / raw)
  To: gregkh; +Cc: mirq-linux, adrian.hunter, ludovic.desroches, stable, ulf.hansson

On Thu, Feb 06, 2020 at 08:08:47PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 5.5-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From a04184ce777b46e92c2b3c93c6dcb2754cb005e1 Mon Sep 17 00:00:00 2001
>From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <mirq-linux@rere.qmqm.pl>
>Date: Thu, 2 Jan 2020 11:42:16 +0100
>Subject: [PATCH] mmc: sdhci-of-at91: fix memleak on clk_get failure
>MIME-Version: 1.0
>Content-Type: text/plain; charset=UTF-8
>Content-Transfer-Encoding: 8bit
>
>sdhci_alloc_host() does its work not using managed infrastructure, so
>needs explicit free on error path. Add it where needed.
>
>Cc: <stable@vger.kernel.org>
>Fixes: bb5f8ea4d514 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC")
>Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
>Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
>Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>Link: https://lore.kernel.org/r/b2a44d5be2e06ff075f32477e466598bb0f07b36.1577961679.git.mirq-linux@rere.qmqm.pl
>Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

We're missing 3976656d67c1 ("mmc: sdhci-of-at91: rework clocks
management to support SAM9x60 device") on older kernels. I've fixed it
up and queued for 5.5-4.14. I don't think it applies to older kernels,
but happy to be proven otherwise.

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] mmc: sdhci-of-at91: fix memleak on clk_get failure" failed to apply to 5.5-stable tree
  2020-02-07  1:09 ` Sasha Levin
@ 2020-02-11  6:21   ` Ludovic Desroches
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Desroches @ 2020-02-11  6:21 UTC (permalink / raw)
  To: Sasha Levin; +Cc: gregkh, mirq-linux, adrian.hunter, stable, ulf.hansson

On Thu, Feb 06, 2020 at 08:09:50PM -0500, Sasha Levin wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Thu, Feb 06, 2020 at 08:08:47PM +0100, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 5.5-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > ------------------ original commit in Linus's tree ------------------
> > 
> > From a04184ce777b46e92c2b3c93c6dcb2754cb005e1 Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <mirq-linux@rere.qmqm.pl>
> > Date: Thu, 2 Jan 2020 11:42:16 +0100
> > Subject: [PATCH] mmc: sdhci-of-at91: fix memleak on clk_get failure
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset=UTF-8
> > Content-Transfer-Encoding: 8bit
> > 
> > sdhci_alloc_host() does its work not using managed infrastructure, so
> > needs explicit free on error path. Add it where needed.
> > 
> > Cc: <stable@vger.kernel.org>
> > Fixes: bb5f8ea4d514 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC")
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
> > Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> > Link: https://lore.kernel.org/r/b2a44d5be2e06ff075f32477e466598bb0f07b36.1577961679.git.mirq-linux@rere.qmqm.pl
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> 
> We're missing 3976656d67c1 ("mmc: sdhci-of-at91: rework clocks
> management to support SAM9x60 device") on older kernels. I've fixed it
> up and queued for 5.5-4.14. I don't think it applies to older kernels,
> but happy to be proven otherwise.

Thanks Sasha for taking care of this.

Regards

Ludovic

> 
> --
> Thanks,
> Sasha

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

end of thread, other threads:[~2020-02-11  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 19:08 FAILED: patch "[PATCH] mmc: sdhci-of-at91: fix memleak on clk_get failure" failed to apply to 5.5-stable tree gregkh
2020-02-07  1:09 ` Sasha Levin
2020-02-11  6:21   ` Ludovic Desroches

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).