git: ee417f9f7f27 - main - acpi: Tasks: Use M_WAITOK to allocate the taskqueue

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Fri, 13 Nov 2026 18:49:50 UTC
The branch main has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=ee417f9f7f27b3dd3e97aeac0daba66cf9bf3c97

commit ee417f9f7f27b3dd3e97aeac0daba66cf9bf3c97
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-10-03 20:33:37 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-11-13 18:32:25 +0000

    acpi: Tasks: Use M_WAITOK to allocate the taskqueue
    
    Memory failure at this point normally does not happen except if the
    kernel is running on a machine with a too tiny amount of memory, in
    which case it is likely to panic or to be unusable anyway.  However,
    letting it panic here with a NULL pointer dereference is not very
    helpful.  Instead, use M_WAITOK, hoping the memory allocator itself will
    indicate the low memory condition if it cannot succeed (if it does not,
    it should be changed to).
    
    Reviewed by:    obiwac
    Differential revision:  https://reviews.freebsd.org/D60379
---
 sys/dev/acpica/Osd/OsdSchedule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c
index c39d4112a039..957fe3e69a7c 100644
--- a/sys/dev/acpica/Osd/OsdSchedule.c
+++ b/sys/dev/acpica/Osd/OsdSchedule.c
@@ -109,7 +109,7 @@ acpi_taskq_init(void *arg)
 {
     int i;
 
-    acpi_taskq = taskqueue_create_fast("acpi_task", M_NOWAIT,
+    acpi_taskq = taskqueue_create_fast("acpi_task", M_WAITOK,
 	&taskqueue_thread_enqueue, &acpi_taskq);
     taskqueue_start_threads(&acpi_taskq, acpi_max_threads, PWAIT, "acpi_task");
     if (acpi_task_count > 0) {