summaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorLuke Kosewski <lkosewsk@nit.ca>2005-06-01 02:39:28 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2005-06-01 02:39:28 -0500
commite334016fc1735e491385e14157a0360cd85c321b (patch)
treeedc583a85baac6975b38b8684825f3dfcbfc53b7 /drivers/input/input.c
parentb6cbf3ef4f270c0dfe84b26649e4fc0c25bb0844 (diff)
downloadop-kernel-dev-e334016fc1735e491385e14157a0360cd85c321b.zip
op-kernel-dev-e334016fc1735e491385e14157a0360cd85c321b.tar.gz
Input: do not corrupt system-wide procfs fops.
entry->proc_fops is a pointer to struct file_operations. When we call create_proc_entry(...), it pointis to proc_file_operations, deep in fs/proc/generic.c. By adding a 'poll' member to this struct we effectively force the 'poll' member on every file in /proc, which is wrong (they all fail select(...) calls). This patch changes a copy of entry->proc_fops and reassigns it rather than changing the original member. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 1885f36..c1dbc04 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -697,6 +697,8 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in
return (count > cnt) ? cnt : count;
}
+static struct file_operations input_fileops;
+
static int __init input_proc_init(void)
{
struct proc_dir_entry *entry;
@@ -711,6 +713,8 @@ static int __init input_proc_init(void)
return -ENOMEM;
}
entry->owner = THIS_MODULE;
+ input_fileops = *entry->proc_fops;
+ entry->proc_fops = &input_fileops;
entry->proc_fops->poll = input_devices_poll;
entry = create_proc_read_entry("handlers", 0, proc_bus_input_dir, input_handlers_read, NULL);
if (entry == NULL) {
OpenPOWER on IntegriCloud