diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-14 01:32:14 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-14 01:32:14 -0400 |
commit | 655816e49867082d13ece0da31d76e12cc0de4a5 (patch) | |
tree | 6217dd7134def6cccdc90d41491c87c32591a2f4 /drivers/input/input.c | |
parent | 66e66118837ed95a299328437c2d9fb4b5137352 (diff) |
Input: fix input module refcounting
Now that input_free_device is basically an alias for input_put_device
we need to acquire a reference to input module right when we allocate
device because input_dev_release releases reference to input module
unconditionally.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r-- | drivers/input/input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 4954c790ccb1..f2c85a60a0dc 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -912,6 +912,8 @@ struct input_dev *input_allocate_device(void) mutex_init(&dev->mutex); INIT_LIST_HEAD(&dev->h_list); INIT_LIST_HEAD(&dev->node); + + __module_get(THIS_MODULE); } return dev; @@ -985,8 +987,6 @@ int input_register_device(struct input_dev *dev) if (error) goto fail3; - __module_get(THIS_MODULE); - path = kobject_get_path(&dev->cdev.kobj, GFP_KERNEL); printk(KERN_INFO "input: %s as %s\n", dev->name ? dev->name : "Unspecified device", path ? path : "N/A"); |