Re: [PATCH v3] EDAC/altera: Fix device node reference leaks in the SDMMC ECC setup
From: Borislav Petkov
Date: Sat Sep 26 2026 - 15:00:35 EST
On Sat, Sep 26, 2026 at 05:38:46PM +0530, Rounak Das wrote:
> Under altr_portb_setup() and socfpga_init_sdmmc_ecc(),
> of_find_compatible_node() was being used to look up the sdmmc-ecc
> node. This node wasn't being dropped using of_node_put().
>
> altr_portb_setup() did not drop its reference under its success path
> or on any error path.
>
> socfpga_init_sdmmc_ecc() did an early return thereby skipping the
> common exit label and thus leaking the reference.
>
> Add the missing of_node_put() calls in altr_portb_setup(), and route
> socfpga_init_sdmmc_ecc()'s success path through the common exit label.
>
> Fixes: 911049845d70 ("EDAC, altera: Add Arria10 SD-MMC EDAC support")
> Fixes: 788586efd116 ("EDAC/altera: Initialize peripheral FIFOs in probe()")
> Cc: stable@xxxxxxxxxxxxxxx # 6.18+
> Closes: https://sashiko.dev/#/patchset/20260708091135.94114-1-rounakdas2025%40gmail.com
> Acked-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>
> Signed-off-by: Rounak Das <rounakdas2025@xxxxxxxxx>
> ---
> v3:
> - Rebase on top of Dinh's "Address sashiko reviews part 1" series (Dinh).
> - Limit stable backport to 6.18+.
> v2: https://lore.kernel.org/all/20260717131720.19038-1-rounakdas2025@xxxxxxxxx/
> v1: https://lore.kernel.org/all/20260717102549.13309-1-rounakdas2025@xxxxxxxxx/
> ---
> drivers/edac/altera_edac.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
Applied, thanks.
Btw, Dinh, that altr_portb_setup() needs proper scrubbing and reworking of the
error handling into using proper goto labels. Otherwise, there'll be more
sprinkling of unwinding functions like in this patch everywhere and this'll
turn into a real nightmare soon.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette