Re: [PATCH] arm_mpam: Free error_dev_id when destroying an MSC
From: Ping Li
Date: Thu Dec 03 2026 - 22:28:40 EST
Hi Ben,
On 03/12/2026 16:15, Ben Horgan wrote:
> With this the msc->error_dev_id is still leaked if the probe fails. As such, I'm planning on taking
> https://lore.kernel.org/linux-arm-kernel/20261124135843.2276437-1-liguangshuo@xxxxxxxxxxxxxxx/ instead of this patch
> even though you did post first.
Thanks for taking a look, and for the pointer to Guangshuo's patch.
You're right - mine only hooks mpam_msc_destroy(), so probe failures
after mpam_msc_setup_error_irq() still leak the allocation. I've read
the devm_alloc_percpu() version and am happy to withdraw mine in its
favour - devres cleanup covers both the probe-failure path and device
removal.
Glad the bug is being fixed either way.
Thanks,
Ping