summaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
author Peter Collingbourne <pcc@google.com> 2022-11-02 20:02:29 -0700
committer Peter Collingbourne <pcc@google.com> 2022-11-03 10:52:44 -0700
commit9bb7cb8af10ab92373e4638172999478b1e76bfb (patch)
tree50bc2526f855b182a579c7f32a99e7d05168b0ca /api/api.go
parent5fe69e14cae1cada5f40acd60824b8bc9b8d1852 (diff)
Fix division by zero in maybeAdjustDesiredStockLevelLocked().
If getBatteryScreenOffDischargeMah() returns zero that will lead to a division by zero when computing estimatedLifeHours that will bring down the entire system server. Guard against this by returning from the function early if it returns zero. Change-Id: I4905d7184e5185a07e4185fa0e263559d85cff49
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions