From c903c5fbaec3a8bacb8340a5c4e76b6941dbc6fe Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 31 Dec 2007 15:56:03 +0000 Subject: [PATCH] Use devclass_get_count() instead of devclass_get_maxunit() to get the correct number of acpi_thermalX devices. Having this wrong caused the acpi_thermal thread to realloc the array of devices on each loop iteration. MFC after: 1 week PR: kern/118497 Submitted by: Pasi Parviainen --- sys/dev/acpica/acpi_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c index 045d2ba197c..383de56310d 100644 --- a/sys/dev/acpica/acpi_thermal.c +++ b/sys/dev/acpica/acpi_thermal.c @@ -914,7 +914,7 @@ acpi_tz_thread(void *arg) for (;;) { /* If the number of devices has changed, re-evaluate. */ - if (devclass_get_maxunit(acpi_tz_devclass) != devcount) { + if (devclass_get_count(acpi_tz_devclass) != devcount) { if (devs != NULL) { free(devs, M_TEMP); free(sc, M_TEMP);