Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140904510
D54311.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
704 B
Referenced Files
None
Subscribers
None
D54311.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D54311: acpi: Reject duplicate handlers for ioctl commands
Attached
Detach File
Event Timeline
Log In to Comment