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
This commit is contained in:
John Baldwin 2007-12-31 15:56:03 +00:00
parent 89dbcee8ce
commit c903c5fbae

View file

@ -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);