[PATCH] perf: qcom_l2_pmu: Make l2_cache_pmu_probe_cluster() more robust

Will Deacon will at kernel.org
Mon Jun 5 09:35:03 PDT 2023


On Thu, 18 May 2023 10:18:08 +0200, Christophe JAILLET wrote:
> If an error occurs after calling list_add(), the &l2cache_pmu->clusters
> list will reference some memory that will be freed when the managed
> resources will be released.
> 
> Move the list_add() at the end of the function when everything is in fine.
> 
> This is harmless because if l2_cache_pmu_probe_cluster() fails, then
> l2_cache_pmu_probe() will fail as well and 'l2cache_pmu' will be released
> as well.
> But it looks cleaner and could silence static checker warning.
> 
> [...]

Applied to will (for-next/perf), thanks!

[1/1] perf: qcom_l2_pmu: Make l2_cache_pmu_probe_cluster() more robust
      https://git.kernel.org/will/c/7bd42f122c7c

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list