Skip to content

Commit

Permalink
apm_power: check I.intval for zero value, we use it as the divisor
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
  • Loading branch information
Anton Vorontsov committed Feb 1, 2008
1 parent ae4bb15 commit e91926e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/power/apm_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e91926e

Please sign in to comment.