Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F81449435
acpi_battery div by zero quick & dirty patch
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
jeffpc_josefsipek.net
Apr 16 2024, 1:24 PM
2024-04-16 13:24:17 (UTC+0)
Size
499 B
Referenced Files
None
Subscribers
None
acpi_battery div by zero quick & dirty patch
View Options
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;
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8823188
Default Alt Text
acpi_battery div by zero quick & dirty patch (499 B)
Attached To
Mode
P636 acpi_battery div by zero quick & dirty patch
Attached
Detach File
Event Timeline
Log In to Comment