Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 377c09d7 authored by Patrick Fay's avatar Patrick Fay
Browse files

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: default avatarPatrick Fay <pfay@codeaurora.org>
parent 573979de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment