diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c --- a/sys/dev/acpica/acpi_battery.c +++ b/sys/dev/acpica/acpi_battery.c @@ -266,7 +266,7 @@ acpi_battery_get_battinfo(device_t dev, */ if (valid_units > 0) { if (dev == NULL) { - battinfo->cap = (total_cap * 100) / total_lfcap; + battinfo->cap = total_lfcap ? ((total_cap * 100) / total_lfcap) : 0; battinfo->min = total_min; battinfo->state = batt_stat; battinfo->rate = valid_rate;