[PATCH v8 01/22] RISC-V: perf: fix resource cleanup on driver probe failure

Paul Walmsley pjw at kernel.org
Tue Aug 4 16:25:33 PDT 2026


On Wed, 1 Jul 2026, Atish Patra wrote:

> From: Atish Patra <atishp at meta.com>
> 
> Sashiko pointed out various UAF and memory leak issues around
> pmu_sbi_device_probe() error paths.
> 
> If the probe fails, here are list of cleanups needed.
> a. Already registered pmu must be freed
> b. per cpu IRQ must be released
> c. pmu_ctr_list data structure must be freed
> d. cpu hotplug state must be cleaned up only if added.
> 
> Fix the resource cleanup by reorganizing the code around probe failure.
> 
> Reported-by: Sashiko AI <sashiko-bot at kernel.org>
> Signed-off-by: Atish Patra <atishp at meta.com>

Thanks, queued for v7.3.


- Paul



More information about the linux-arm-kernel mailing list