mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
apm_power: check I.intval for zero value, we use it as the divisor
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
This commit is contained in:
parent
ae4bb15290
commit
e91926e9ea
1 changed files with 3 additions and 0 deletions
|
@ -133,6 +133,9 @@ static int do_calculate_time(int status, enum apm_source source)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!I.intval)
|
||||
return 0;
|
||||
|
||||
switch (source) {
|
||||
case SOURCE_CHARGE:
|
||||
full_prop = POWER_SUPPLY_PROP_CHARGE_FULL;
|
||||
|
|
Loading…
Reference in a new issue