From: Helge Deller Date: Mon, 24 Mar 2008 15:02:06 +0000 (-0400) Subject: Input: apm-power - fix crash when unloading modules X-Git-Tag: v2.6.25-rc8~9^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=481419ec9fbdf3f4ec5389c7e91a81b4a7ebee8d;p=linux-2.6 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c index c36d110b34..7d61a96608 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, 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); }