aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2008-03-24 11:02:06 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-03-24 11:02:06 -0400
commit481419ec9fbdf3f4ec5389c7e91a81b4a7ebee8d (patch)
treee208ea6610a99da05fc5f1eb0e64cad16882f231 /drivers
parent688dad4f4c9004fcaa4cadad167b064342be5d63 (diff)
Input: apm-power - fix crash when unloading modules
Fix a crash in the apm-power driver when an input-device, such as keyboard driver module, is unloaded. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/apm-power.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c
index c36d110b349a..7d61a9660806 100644
--- a/drivers/input/apm-power.c
+++ b/drivers/input/apm-power.c
@@ -63,8 +63,6 @@ static int apmpower_connect(struct input_handler *handler,
63 handle->handler = handler; 63 handle->handler = handler;
64 handle->name = "apm-power"; 64 handle->name = "apm-power";
65 65
66 handler->private = handle;
67
68 error = input_register_handle(handle); 66 error = input_register_handle(handle);
69 if (error) { 67 if (error) {
70 printk(KERN_ERR 68 printk(KERN_ERR
@@ -87,11 +85,10 @@ static int apmpower_connect(struct input_handler *handler,
87 return 0; 85 return 0;
88} 86}
89 87
90static void apmpower_disconnect(struct input_handle *handler) 88static void apmpower_disconnect(struct input_handle *handle)
91{ 89{
92 struct input_handle *handle = handler->private;
93
94 input_close_device(handle); 90 input_close_device(handle);
91 input_unregister_handle(handle);
95 kfree(handle); 92 kfree(handle);
96} 93}
97 94