[PATCH] EDAC/pci: Fix potential private data leak on release
From: Guangshuo Li
Date: Tue Nov 03 2026 - 21:34:51 EST
edac_pci_alloc_ctl_info() allocates pvt_info separately from the
controller, but the instance release callback only frees the
controller. Release the private allocation there as well, when
the final instance reference is dropped.
This issue was found by our static analysis tool under development.
Fixes: fb8cd45ca39b ("EDAC/pci: Get rid of the silly one-shot memory allocation in edac_pci_alloc_ctl_info()")
Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
---
Build-tested the changed object with x86_64 GCC W=1, using defconfig
with the driver dependencies enabled. No hardware/kernel runtime test or full linked-kernel
build.
OpenAI Codex assisted with source review, patch implementation and
commit-message drafting. The submitter has reviewed the changes.
drivers/edac/edac_pci_sysfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index 9f437f648e4e..cdb9291765e3 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -83,6 +83,7 @@ static void edac_pci_instance_release(struct kobject *kobj)
/* decrement reference count on top main kobj */
kobject_put(edac_pci_top_main_kobj);
+ kfree(pci->pvt_info);
kfree(pci); /* Free the control struct */
}
base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d