From: Anton Vorontsov Date: Sat, 12 Jan 2008 23:44:54 +0000 (+0300) Subject: apm_power: check I.intval for zero value, we use it as the divisor X-Git-Tag: v2.6.25-rc1~1071^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e91926e9ea9073d8ce95b74602e8c2d775f5a793;p=linux-2.6-omap-h63xx.git apm_power: check I.intval for zero value, we use it as the divisor Signed-off-by: Anton Vorontsov --- diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c index a832a9a05c6..a4892275659 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;