perf: Fix NULL pointer ref in exclude_idle update
Commit 573979de ("perf: Add support for exclude_idle attribute") registers an idle callback routine armv8pmu_idle_update. Currently the idle update routine might be called before the pmu has allocated all the per_cpu structures. This can result in a null pointer reference. Change arm_pmu_device_probe to allocate the structures via cpu_pmu_init() before the init_fn() call (which eventually does the idle_notify_register call). Change a branch to out_free to out_destroy as out_free doesn't cleanup what was allocated in cpu_pmu_init(). Also have armv8pmu_idle_update check that the structure is not null before using it. Change-Id: Ie1198fc1783804c61467889c68656d6e8c9c9edf Signed-off-by:Patrick Fay <pfay@codeaurora.org>
Loading
Please register or sign in to comment