Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e91926e9 authored by Anton Vorontsov's avatar Anton Vorontsov
Browse files

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



Signed-off-by: default avatarAnton Vorontsov <cbou@mail.ru>
parent ae4bb152
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;