Linux kernel -stable discussions
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] EDAC/altera: Fix memory leak on dci allocation failure" failed to apply to 5.15-stable tree
@ 2026-10-05 10:27 gregkh
  2026-10-05 14:27 ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2026-10-05 10:27 UTC (permalink / raw)
  To: dinguyen, bp; +Cc: stable


The patch below does not apply to the 5.15-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>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 3e4a10a4718e3d963ee4d6c5f26bc5ad57c1d2b1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026100524-payer-capricorn-e50f@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'

Possible dependencies:



thanks,

greg k-h

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

From 3e4a10a4718e3d963ee4d6c5f26bc5ad57c1d2b1 Mon Sep 17 00:00:00 2001
From: Dinh Nguyen <dinguyen@kernel.org>
Date: Fri, 11 Sep 2026 07:06:26 -0500
Subject: [PATCH] EDAC/altera: Fix memory leak on dci allocation failure

Sashiko reports:

"If devres_open_group() fails, the function returns -ENOMEM without freeing the
dci structure allocated earlier with edac_device_alloc_ctl_info()."

Free the dci structure if devres_open_group() fails.

Fixes: c3eea1942a16 ("EDAC, altera: Add Altera L2 cache and OCRAM support")
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org # 6.18+
Link: https://patch.msgid.link/20260911120627.2634225-4-dinguyen@kernel.org

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index d8a3438fb5f4..ccdfb35178b6 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1516,8 +1516,10 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
 	altdev = dci->pvt_info;
 	*altdev = *device;
 
-	if (!devres_open_group(device->edac->dev, altr_portb_setup, GFP_KERNEL))
+	if (!devres_open_group(device->edac->dev, altr_portb_setup, GFP_KERNEL)) {
+		edac_device_free_ctl_info(dci);
 		return -ENOMEM;
+	}
 
 	/* Update PortB specific values */
 	altdev->edac_dev_name = ecc_name;


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

* Re: FAILED: patch "[PATCH] EDAC/altera: Fix memory leak on dci allocation failure" failed to apply to 5.15-stable tree
  2026-10-05 10:27 FAILED: patch "[PATCH] EDAC/altera: Fix memory leak on dci allocation failure" failed to apply to 5.15-stable tree gregkh
@ 2026-10-05 14:27 ` Borislav Petkov
  2026-10-05 14:51   ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2026-10-05 14:27 UTC (permalink / raw)
  To: gregkh; +Cc: dinguyen, stable

On Mon, Oct 05, 2026 at 12:27:24PM +0200, gregkh@linuxfoundation.org wrote:
> 
> The patch below does not apply to the 5.15-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>.
> 
> To reproduce the conflict and resubmit, you may use the following commands:
> 
> git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
> git checkout FETCH_HEAD
> git cherry-pick -x 3e4a10a4718e3d963ee4d6c5f26bc5ad57c1d2b1
> # <resolve conflicts, build, test, etc.>
> git commit -s
> git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026100524-payer-capricorn-e50f@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'
> 
> Possible dependencies:
> 
> 
> 
> thanks,
> 
> greg k-h
> 
> ------------------ original commit in Linus's tree ------------------
> 
> From 3e4a10a4718e3d963ee4d6c5f26bc5ad57c1d2b1 Mon Sep 17 00:00:00 2001
> From: Dinh Nguyen <dinguyen@kernel.org>
> Date: Fri, 11 Sep 2026 07:06:26 -0500
> Subject: [PATCH] EDAC/altera: Fix memory leak on dci allocation failure
> 
> Sashiko reports:
> 
> "If devres_open_group() fails, the function returns -ENOMEM without freeing the
> dci structure allocated earlier with edac_device_alloc_ctl_info()."
> 
> Free the dci structure if devres_open_group() fails.
> 
> Fixes: c3eea1942a16 ("EDAC, altera: Add Altera L2 cache and OCRAM support")
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> Cc: stable@vger.kernel.org # 6.18+
			       ^^^^^

You probably should drop all backports before 6.18.

Like we marked it!!! :-P

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

* Re: FAILED: patch "[PATCH] EDAC/altera: Fix memory leak on dci allocation failure" failed to apply to 5.15-stable tree
  2026-10-05 14:27 ` Borislav Petkov
@ 2026-10-05 14:51   ` Greg KH
  2026-10-05 14:57     ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2026-10-05 14:51 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: dinguyen, stable

On Mon, Oct 05, 2026 at 07:27:32AM -0700, Borislav Petkov wrote:
> On Mon, Oct 05, 2026 at 12:27:24PM +0200, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 5.15-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>.
> > 
> > To reproduce the conflict and resubmit, you may use the following commands:
> > 
> > git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
> > git checkout FETCH_HEAD
> > git cherry-pick -x 3e4a10a4718e3d963ee4d6c5f26bc5ad57c1d2b1
> > # <resolve conflicts, build, test, etc.>
> > git commit -s
> > git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026100524-payer-capricorn-e50f@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'
> > 
> > Possible dependencies:
> > 
> > 
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > ------------------ original commit in Linus's tree ------------------
> > 
> > From 3e4a10a4718e3d963ee4d6c5f26bc5ad57c1d2b1 Mon Sep 17 00:00:00 2001
> > From: Dinh Nguyen <dinguyen@kernel.org>
> > Date: Fri, 11 Sep 2026 07:06:26 -0500
> > Subject: [PATCH] EDAC/altera: Fix memory leak on dci allocation failure
> > 
> > Sashiko reports:
> > 
> > "If devres_open_group() fails, the function returns -ENOMEM without freeing the
> > dci structure allocated earlier with edac_device_alloc_ctl_info()."
> > 
> > Free the dci structure if devres_open_group() fails.
> > 
> > Fixes: c3eea1942a16 ("EDAC, altera: Add Altera L2 cache and OCRAM support")
> > Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> > Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> > Cc: stable@vger.kernel.org # 6.18+
> 			       ^^^^^
> 
> You probably should drop all backports before 6.18.
> 
> Like we marked it!!! :-P

Ugh, but the Fixes: tag points at 4.6, so which do I believe?  :)

thanks for letting me know.

greg k-h

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

* Re: FAILED: patch "[PATCH] EDAC/altera: Fix memory leak on dci allocation failure" failed to apply to 5.15-stable tree
  2026-10-05 14:51   ` Greg KH
@ 2026-10-05 14:57     ` Borislav Petkov
  0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2026-10-05 14:57 UTC (permalink / raw)
  To: Greg KH; +Cc: dinguyen, stable

On Mon, Oct 05, 2026 at 04:51:24PM +0200, Greg KH wrote:
> Ugh, but the Fixes: tag points at 4.6, so which do I believe?  :)

Yeah, I know. Dinh wanted it limited to 6.18 and newer only.

> thanks for letting me know.

Anytime.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, other threads:[~2026-10-05 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-05 10:27 FAILED: patch "[PATCH] EDAC/altera: Fix memory leak on dci allocation failure" failed to apply to 5.15-stable tree gregkh
2026-10-05 14:27 ` Borislav Petkov
2026-10-05 14:51   ` Greg KH
2026-10-05 14:57     ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox