Re: [PATCH v2] EDAC/altera: Fix SDMMC PortB OF node reference leak
From: Borislav Petkov
Date: Mon Jun 01 2026 - 09:54:05 EST
On Sun, May 03, 2026 at 05:25:58PM -0400, Yuho Choi wrote:
> of_find_compatible_node() returns a device node with its refcount
> incremented. altr_portb_setup() looks up the SDMMC ECC node but does
> not drop that reference on error paths or after successful setup.
>
> Route those exits through an of_node_put() cleanup path. Also free the
> EDAC control info if devres_open_group() fails after dci has been
> allocated, and release the devres group before freeing dci because
> altdev is stored in dci->pvt_info.
>
> Fixes: 911049845d70 ("EDAC, altera: Add Arria10 SD-MMC EDAC support")
> Signed-off-by: Yuho Choi <dbgh9129@xxxxxxxxx>
> ---
> Changes since v1:
> - Free the EDAC control info when devres_open_group() fails after dci
> has been allocated.
> - Release the PortB devres group before freeing dci so altdev->ddev
> remains valid during devres cleanup.
> - Keep the !dci failure path limited to dropping the OF node reference.
https://sashiko.dev/#/patchset/20260503212558.2811480-1-dbgh9129%40gmail.com
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette