Re: [PATCH v8 01/22] RISC-V: perf: fix resource cleanup on driver probe failure
From: Paul Walmsley
Date: Tue Aug 04 2026 - 19:25:51 EST
On Wed, 1 Jul 2026, Atish Patra wrote:
> From: Atish Patra <atishp@xxxxxxxx>
>
> 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@xxxxxxxxxx>
> Signed-off-by: Atish Patra <atishp@xxxxxxxx>
Thanks, queued for v7.3.
- Paul