diff options
author | Brendan Jackman <[email protected]> | 2016-08-17 16:14:59 +0100 |
---|---|---|
committer | Zhang Rui <[email protected]> | 2016-08-19 21:32:18 +0800 |
commit | a305a4387acb01cecadeeea5151c049a022a1bfc (patch) | |
tree | 4563fb3c6b8956491b1326ba5ec3d160b9850fda /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | 694d0d0bb2030d2e36df73e2d23d5770511dbc8d (diff) |
thermal: cpu_cooling: Fix NULL dereference in cpufreq_state2power
Currently all CPU cooling devices share a
`struct thermal_cooling_device_ops` instance. The thermal core uses the
presence of functions in this struct to determine if a cooling device
has a power model (see cdev_is_power_actor). cpu_cooling.c adds the
power model functions to the shared struct when a device is registered
with a power model.
Therefore, if a CPU cooling device is registered using
[of_]cpufreq_power_cooling_register, _all_ devices will be determined to
have a power model, including any registered with
[of_]cpufreq_cooling_register. This can result in cpufreq_state2power
being called on a device where dyn_power_table is NULL.
With this commit, instead of having a shared thermal_cooling_device_ops
which is mutated, we have two versions: one with the power functions and
one without.
Signed-off-by: Brendan Jackman <[email protected]>
Cc: Amit Daniel Kachhap <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Javi Merino <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Acked-by: Javi Merino <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions