Page MenuHomeFreeBSD

D54311.diff
No OneTemporary

D54311.diff

diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -4203,7 +4203,7 @@
int
acpi_register_ioctl(u_long cmd, acpi_ioctl_fn fn, void *arg)
{
- struct acpi_ioctl_hook *hp;
+ struct acpi_ioctl_hook *hp, *thp;
if ((hp = malloc(sizeof(*hp), M_ACPIDEV, M_NOWAIT)) == NULL)
return (ENOMEM);
@@ -4216,6 +4216,14 @@
TAILQ_INIT(&acpi_ioctl_hooks);
acpi_ioctl_hooks_initted = 1;
}
+ TAILQ_FOREACH(thp, &acpi_ioctl_hooks, link) {
+ if (thp->cmd == cmd) {
+ ACPI_UNLOCK(acpi);
+ free(hp, M_ACPIDEV);
+ return (EBUSY);
+ }
+ }
+
TAILQ_INSERT_TAIL(&acpi_ioctl_hooks, hp, link);
ACPI_UNLOCK(acpi);

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 30, 11:24 AM (3 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27098311
Default Alt Text
D54311.diff (704 B)

Event Timeline