linux/drivers/edac
Prasanna Kumar T S M 8cf5dd235e EDAC/versalnet: Fix device name memory leak
The device name allocated via kzalloc() in init_one_mc() is assigned to
dev->init_name but never freed on the normal removal path.  device_register()
copies init_name and then sets dev->init_name to NULL, so the name pointer
becomes unreachable from the device. Thus leaking memory.

Use a stack-local char array instead of using kzalloc() for name.

Fixes: d5fe2fec6c ("EDAC: Add a driver for the AMD Versal NET DDR controller")
Signed-off-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260401111856.2342975-1-ptsm@linux.microsoft.com
2026-05-05 14:49:48 +02:00
..
a72_edac.c EDAC: Add EDAC driver for ARM Cortex A72 cores 2025-08-15 23:37:00 +02:00
al_mc_edac.c
altera_edac.c EDAC/altera: Remove IRQF_ONESHOT 2026-02-01 17:37:15 +01:00
altera_edac.h EDAC/altera: Drop unused field eccmgr_sysfs_attr 2026-03-11 20:46:52 +01:00
amd64_edac.c EDAC/amd64: Add support for family 19h, models 40h-4fh 2026-03-19 19:03:25 +01:00
amd64_edac.h EDAC/amd64: Remove NUM_CONTROLLERS macro 2025-11-06 12:51:33 +01:00
amd76x_edac.c
armada_xp_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
aspeed_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
bluefield_edac.c EDAC/bluefield: Don't use bluefield_edac_readl() result on error 2025-05-22 17:58:28 +02:00
cpc925_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
debugfs.c EDAC: Use string choice helper functions 2025-02-25 22:19:55 +01:00
dmc520_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
e7xxx_edac.c
e752x_edac.c
ecs.c EDAC: Fix wrong executable file modes for C source files 2025-08-30 17:23:06 +02:00
edac_device_sysfs.c EDAC/device: Allow addition of const sysfs attributes 2026-03-11 22:33:38 +01:00
edac_device.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
edac_device.h EDAC/device: Allow addition of const sysfs attributes 2026-03-11 22:33:38 +01:00
edac_mc_sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
edac_mc.c - amd64_edac: Add support for AMD Zen 3 (family 19h, models 40h–4fh) 2026-04-14 15:29:55 -07:00
edac_mc.h
edac_module.c
edac_module.h
edac_pci_sysfs.c EDAC/pci_sysfs: Constify instance sysfs attributes 2026-03-11 22:26:38 +01:00
edac_pci.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
edac_pci.h
fsl_ddr_edac.c EDAC/fsl_ddr: Add support for i.MX9 DDR controller 2024-10-23 16:53:55 +02:00
fsl_ddr_edac.h EDAC/fsl_ddr: Add support for i.MX9 DDR controller 2024-10-23 16:53:55 +02:00
ghes_edac.c EDAC/ghes: Replace deprecated strcpy() in ghes_edac_report_mem_error() 2025-11-18 16:50:32 +01:00
highbank_l2_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
highbank_mc_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
i7core_edac.c EDAC/i7core: Use kzalloc_flex() 2026-03-13 15:03:36 -07:00
i10nm_base.c EDAC/i10nm: Fix spelling mistake "readd" -> "read" 2026-03-25 14:04:06 -07:00
i3000_edac.c
i3200_edac.c EDAC/i3200: Fix a resource leak in i3200_probe1() 2026-01-04 08:31:44 +01:00
i5000_edac.c EDAC/i5000: Fix snprintf() size calculation in calculate_dimm_size() 2025-12-17 09:59:17 -08:00
i5100_edac.c
i5400_edac.c EDAC/i5400: Fix snprintf() limit calculation in calculate_dimm_size() 2025-12-17 10:00:20 -08:00
i7300_edac.c EDAC: Use string choice helper functions 2025-02-25 22:19:55 +01:00
i82860_edac.c
i82875p_edac.c
i82975x_edac.c
ie31200_edac.c EDAC/ie31200: Make rpl_s_cfg static 2026-03-27 22:20:49 +01:00
igen6_edac.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
imh_base.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig EDAC/r82600: Remove this obsolete driver 2026-01-30 13:41:32 +01:00
layerscape_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
loongson_edac.c EDAC: Add an EDAC driver for the Loongson memory controller 2025-01-04 12:02:04 +01:00
Makefile EDAC/r82600: Remove this obsolete driver 2026-01-30 13:41:32 +01:00
mce_amd.c x86/mce, EDAC/mce_amd: Add new SMCA bank types 2026-03-11 13:51:59 +01:00
mce_amd.h
mem_repair.c EDAC: Fix wrong executable file modes for C source files 2025-08-30 17:23:06 +02:00
mpc85xx_edac.c EDAC/mpc85xx: Constify device sysfs attributes 2026-03-11 22:34:07 +01:00
mpc85xx_edac.h
npcm_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
octeon_edac-l2c.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
octeon_edac-lmc.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
octeon_edac-pc.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
octeon_edac-pci.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pasemi_edac.c
pnd2_edac.c EDAC/pnd2: Make read-only const array intlv static 2025-03-03 16:39:26 +01:00
pnd2_edac.h
qcom_edac.c EDAC/qcom: Correct interrupt enable register configuration 2025-02-14 20:36:11 +01:00
sb_edac.c EDAC/sb: Use kzalloc_flex() 2026-03-13 15:04:33 -07:00
scrub.c EDAC: Fix wrong executable file modes for C source files 2025-08-30 17:23:06 +02:00
sifive_edac.c
skx_base.c EDAC/{skx_common,skx,i10nm}: Make skx_register_mci() independent of pci_dev 2025-11-19 12:11:40 -08:00
skx_common.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
skx_common.h EDAC/{skx_comm,imh}: Detect 2-level memory configuration 2025-11-21 10:20:51 -08:00
synopsys_edac.c EDAC/synopsys: Clear the ECC counters on init 2025-07-14 12:15:37 +02:00
thunderx_edac.c
ti_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
versal_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
versalnet_edac.c EDAC/versalnet: Fix device name memory leak 2026-05-05 14:49:48 +02:00
wq.c
x38_edac.c EDAC/x38: Fix a resource leak in x38_probe1() 2026-01-04 08:35:39 +01:00
xgene_edac.c EDAC: Use string choice helper functions 2025-02-25 22:19:55 +01:00
zynqmp_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00