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>
This commit is contained in:
Helge Deller 2008-03-24 11:02:06 -04:00 committed by Dmitry Torokhov
parent 688dad4f4c
commit 481419ec9f
1 changed files with 2 additions and 5 deletions

View File

@ -63,8 +63,6 @@ static int apmpower_connect(struct input_handler *handler,
handle->handler = handler;
handle->name = "apm-power";
handler->private = handle;
error = input_register_handle(handle);
if (error) {
printk(KERN_ERR
@ -87,11 +85,10 @@ static int apmpower_connect(struct input_handler *handler,
return 0;
}
static void apmpower_disconnect(struct input_handle *handler)
static void apmpower_disconnect(struct input_handle *handle)
{
struct input_handle *handle = handler->private;
input_close_device(handle);
input_unregister_handle(handle);
kfree(handle);
}