Commit e91926e9ea9073d8ce95b74602e8c2d775f5a793

Authored by Anton Vorontsov
1 parent ae4bb15290

apm_power: check I.intval for zero value, we use it as the divisor

Signed-off-by: Anton Vorontsov <cbou@mail.ru>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

drivers/power/apm_power.c
... ... @@ -133,6 +133,9 @@
133 133 return -1;
134 134 }
135 135  
  136 + if (!I.intval)
  137 + return 0;
  138 +
136 139 switch (source) {
137 140 case SOURCE_CHARGE:
138 141 full_prop = POWER_SUPPLY_PROP_CHARGE_FULL;