Re: [PATCH v2] EDAC/synopsys: Fix cleanup on injection sysfs failure

Borislav Petkov <[email protected]>
Newsgroups org.kernel.vger.linux-edac,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <20260610172722.GAaimeeuKj2aAgUJ9Y@fat_crate.local>
On Fri, Jun 05, 2026 at 08:54:17AM -0400, Yuho Choi wrote:
> edac_create_sysfs_attributes() creates inject_data_error before
> inject_data_poison. If the second file creation fails, the first file is
> left behind.
> 
> The same failure path runs after edac_mc_add_mc() has registered the
> memory controller with the EDAC core. Jumping directly to edac_mc_free()
> skips edac_mc_del_mc() and leaves the registered controller state
> unwound incorrectly.
> 
> Remove inject_data_error when inject_data_poison creation fails, and
> route the probe failure through edac_mc_del_mc() before freeing mci.
> 
> Fixes: 1a81361f75d8 ("EDAC, synopsys: Add Error Injection support for ZynqMP DDR controller")
> Signed-off-by: Yuho Choi <[email protected]>
> ---
> Changes in v2:
> - Remove the CONFIG_EDAC_DEBUG-guarded del_mc label.
> - Call edac_mc_del_mc() inline before jumping to free_edac_mc when
>   edac_create_sysfs_attributes() fails.
> 
>  drivers/edac/synopsys_edac.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

https://sashiko.dev/#/patchset/20260605125417.2348115-1-dbgh9129%40gmail.com

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.