summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/hil_kbd.c
diff options
context:
space:
mode:
authorKyle McMartin <kyle@parisc-linux.org>2006-03-30 16:47:32 (GMT)
committerKyle McMartin <kyle@hera.kernel.org>2006-03-30 17:48:59 (GMT)
commitcd7a9202a5a6e7712df2b80ed5ebd7b078130fc3 (patch)
treec7e2504dd6de0d2412815dce658468f7add77173 /drivers/input/keyboard/hil_kbd.c
parent4da9f131a74d12de56c44da6d522a9116da06805 (diff)
downloadlinux-cd7a9202a5a6e7712df2b80ed5ebd7b078130fc3.tar.xz
[PARISC] Fix double free when removing HIL drivers
On Thu, Mar 30, 2006 at 08:31:02AM -0500, Dmitry Torokhov wrote: > Don't do that, its double free. input_unregister_device() normally > causes release() to be called and free the device. input_free_device > is only to be called when input_register_device has not been called or > failed. > > Plus you might want to unregister device after closing serio port, > otherwise your interrupt routine might be referencing already freed > memory. Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'drivers/input/keyboard/hil_kbd.c')
-rw-r--r--drivers/input/keyboard/hil_kbd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index 99f8c5b..63f387e 100644
--- a/drivers/input/keyboard/hil_kbd.c
+++ b/drivers/input/keyboard/hil_kbd.c
@@ -240,9 +240,8 @@ static void hil_kbd_disconnect(struct serio *serio)
return;
}
- input_unregister_device(kbd->dev);
serio_close(serio);
- input_free_device(kbd->dev);
+ input_unregister_device(kbd->dev);
kfree(kbd);
}