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>

authored by Helge Deller and committed by Dmitry Torokhov 481419ec 688dad4f

+2 -5
+2 -5
drivers/input/apm-power.c
··· 63 63 handle->handler = handler; 64 64 handle->name = "apm-power"; 65 65 66 - handler->private = handle; 67 - 68 66 error = input_register_handle(handle); 69 67 if (error) { 70 68 printk(KERN_ERR ··· 85 87 return 0; 86 88 } 87 89 88 - static void apmpower_disconnect(struct input_handle *handler) 90 + static void apmpower_disconnect(struct input_handle *handle) 89 91 { 90 - struct input_handle *handle = handler->private; 91 - 92 92 input_close_device(handle); 93 + input_unregister_handle(handle); 93 94 kfree(handle); 94 95 } 95 96