⬢ DragonFlyBSD Kernel Audit
DF-2374 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -3242,6 +3242,7 @@
 {
     struct acpi_ioctl_hook	*hp;
 
+    lwkt_gettoken(&acpi_token);
     ACPI_LOCK(acpi);
     TAILQ_FOREACH(hp, &acpi_ioctl_hooks, link)
 	if (hp->cmd == cmd && hp->fn == fn)
@@ -3250,8 +3251,12 @@
     if (hp != NULL) {
 	TAILQ_REMOVE(&acpi_ioctl_hooks, hp, link);
 	kfree(hp, M_ACPIDEV);
+	ACPI_UNLOCK(acpi);
+	lwkt_reltoken(&acpi_token);
+	return;
     }
     ACPI_UNLOCK(acpi);
+    lwkt_reltoken(&acpi_token);
 }
 
 static int