瀏覽代碼

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

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Anton Vorontsov 18 年之前
父節點
當前提交
e91926e9ea
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/power/apm_power.c

+ 3 - 0
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;