Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 481419ec authored by Helge Deller's avatar Helge Deller Committed by Dmitry Torokhov
Browse files

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: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 688dad4f
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -63,8 +63,6 @@ static int apmpower_connect(struct input_handler *handler,
	handle->handler = handler;
	handle->handler = handler;
	handle->name = "apm-power";
	handle->name = "apm-power";


	handler->private = handle;

	error = input_register_handle(handle);
	error = input_register_handle(handle);
	if (error) {
	if (error) {
		printk(KERN_ERR
		printk(KERN_ERR
@@ -87,11 +85,10 @@ static int apmpower_connect(struct input_handler *handler,
	return 0;
	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_close_device(handle);
	input_unregister_handle(handle);
	kfree(handle);
	kfree(handle);
}
}