[PATCH] arm_mpam: Free error_dev_id when destroying an MSC

Ping Li leeonion.muyu at gmail.com
Tue Oct 27 04:19:14 PDT 2026


error_dev_id is allocated with alloc_percpu() when the MSC has a
per-CPU error interrupt, but is never freed. free_percpu_irq() only
releases the irqaction, not the percpu allocation. The msc structure
itself is devm managed, so the leak survives its devm_kfree().

free_percpu() accepts NULL, so MSCs without a PPI error interrupt
are unaffected.

Signed-off-by: Ping Li <leeonion.muyu at gmail.com>
---
 drivers/resctrl/mpam_devices.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index 48adc49b833c..bff0b5da0fe6 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -2423,6 +2423,7 @@ static void mpam_msc_destroy(struct mpam_msc *msc)
 	list_del_rcu(&msc->all_msc_list);
 	synchronize_srcu(&mpam_srcu);
 	mpam_pcc_chan_put(msc->pcc_chan);
+	free_percpu(msc->error_dev_id);
 	platform_set_drvdata(pdev, NULL);
 
 	add_to_garbage(msc);
-- 
2.34.1




More information about the linux-arm-kernel mailing list