Skip to content

Commit

Permalink
Input: apm-power - fix crash when unloading modules
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Helge Deller authored and Dmitry Torokhov committed Mar 24, 2008
1 parent 688dad4 commit 481419e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/input/apm-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

Expand Down

0 comments on commit 481419e

Please sign in to comment.