summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorAnton Vorontsov <cbouatmailru@gmail.com>2008-01-13 02:44:54 +0300
committerAnton Vorontsov <cbouatmailru@gmail.com>2008-02-02 02:44:34 +0300
commite91926e9ea9073d8ce95b74602e8c2d775f5a793 (patch)
tree2aca23d48ea90ab9d78fc38ce9b5abdf4e0d461f /drivers/power
parentae4bb152901e406074ae2a205e1c42941a46bbaf (diff)
downloadlinux-e91926e9ea9073d8ce95b74602e8c2d775f5a793.tar.bz2
apm_power: check I.intval for zero value, we use it as the divisor
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/apm_power.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c
index a832a9a05c66..a4892275659d 100644
--- a/drivers/power/apm_power.c
+++ b/drivers/power/apm_power.c
@@ -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;