summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
author Peter Collingbourne <pcc@google.com> 2021-01-26 11:56:58 -0800
committer Peter Collingbourne <pcc@google.com> 2021-01-26 12:09:59 -0800
commita5ca7665cdb316e51842a32f38b345641c5ac27a (patch)
treeedfd819778063889b03cf7f5fb72f4ba0f912582 /vulkan/libvulkan/api.cpp
parent7c9b62c53bba7552fbc4a8355a3f3de50b4f57f1 (diff)
Avoid integer underflow involving maxFreqCount.
If a device does not have any policy directories under /sys/devices/system/cpu/cpufreq this would previously lead to the cputimeinstate subsystem being initialized with an empty set of policy frequencies. This would lead to integer underflows in various loops that enumerate the frequencies when subtracting 1 from a maxFreqCount variable calculated as 0, resulting in us spending a significant amount of time in these loops, likely leading to an ANR in system_server since at least the loop in clearUidTimes is executed while holding the BatteryStatsImpl lock. Fix the problem by skipping the initialization of cputimeinstate if there are no policy directories. Bug: 142352330 Bug: 178231152 Change-Id: I2ec1e8de0fe2a40ed100c8f14e6ca3f6d6285b82
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
0 files changed, 0 insertions, 0 deletions