mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arm_mpam: Free error_dev_id when destroying an MSC
@ 2026-10-27 11:19 Ping Li
  2026-12-03 16:15 ` Ben Horgan
  0 siblings, 1 reply; 2+ messages in thread
From: Ping Li @ 2026-10-27 11:19 UTC (permalink / raw)
  To: james.morse, ben.horgan
  Cc: linux-kernel, linux-arm-kernel, reinette.chatre, fenghuay, Ping Li

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@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-03 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 11:19 [PATCH] arm_mpam: Free error_dev_id when destroying an MSC Ping Li
2026-12-03 16:15 ` Ben Horgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®