diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-29 04:02:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:22 -0400 |
commit | cf7acfab032ff262f42954328cdfd20a5d9aaaac (patch) | |
tree | 231698d72d4508f3b26f606f18ef844387ec43e5 /drivers/acpi/event.c | |
parent | 667471386d4068e75a6a55b615701ced61eb6333 (diff) |
acpi: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.
Add correct ->owner to proc_fops to fix reading/module unloading race.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/acpi/event.c')
-rw-r--r-- | drivers/acpi/event.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index abec1ca94cf4..0c24bd4d6562 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c | |||
@@ -102,6 +102,7 @@ static unsigned int acpi_system_poll_event(struct file *file, poll_table * wait) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | static const struct file_operations acpi_system_event_ops = { | 104 | static const struct file_operations acpi_system_event_ops = { |
105 | .owner = THIS_MODULE, | ||
105 | .open = acpi_system_open_event, | 106 | .open = acpi_system_open_event, |
106 | .read = acpi_system_read_event, | 107 | .read = acpi_system_read_event, |
107 | .release = acpi_system_close_event, | 108 | .release = acpi_system_close_event, |
@@ -294,10 +295,9 @@ static int __init acpi_event_init(void) | |||
294 | 295 | ||
295 | #ifdef CONFIG_ACPI_PROC_EVENT | 296 | #ifdef CONFIG_ACPI_PROC_EVENT |
296 | /* 'event' [R] */ | 297 | /* 'event' [R] */ |
297 | entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); | 298 | entry = proc_create("event", S_IRUSR, acpi_root_dir, |
298 | if (entry) | 299 | &acpi_system_event_ops); |
299 | entry->proc_fops = &acpi_system_event_ops; | 300 | if (!entry) |
300 | else | ||
301 | return -ENODEV; | 301 | return -ENODEV; |
302 | #endif | 302 | #endif |
303 | 303 | ||