diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-24 22:37:49 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-24 22:38:11 -0800 |
commit | 98b7fb0472f828536a7786df6bd517322c0c17dc (patch) | |
tree | 9963828250cc0bbee2a771ee62604f483f047d25 /drivers/input/joystick/iforce/iforce-usb.c | |
parent | 94ec26c855bc675259e4f1658673f458040affd7 (diff) | |
download | kernel_samsung_smdk4412-98b7fb0472f828536a7786df6bd517322c0c17dc.zip kernel_samsung_smdk4412-98b7fb0472f828536a7786df6bd517322c0c17dc.tar.gz kernel_samsung_smdk4412-98b7fb0472f828536a7786df6bd517322c0c17dc.tar.bz2 |
Input: iforce - fix oops on device disconnect
Do not try to free iforce device when we closing input device; disconnect
is the only place where it should be deleted.
Reported-by: Johannes Ebke <johannes.ebke@physik.uni-muenchen.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joystick/iforce/iforce-usb.c')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-usb.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c index 9f289d8..c0ad883 100644 --- a/drivers/input/joystick/iforce/iforce-usb.c +++ b/drivers/input/joystick/iforce/iforce-usb.c @@ -186,33 +186,19 @@ fail: return err; } -/* Called by iforce_delete() */ -void iforce_usb_delete(struct iforce* iforce) -{ - usb_kill_urb(iforce->irq); - usb_kill_urb(iforce->out); - usb_kill_urb(iforce->ctrl); - - usb_free_urb(iforce->irq); - usb_free_urb(iforce->out); - usb_free_urb(iforce->ctrl); -} - static void iforce_usb_disconnect(struct usb_interface *intf) { struct iforce *iforce = usb_get_intfdata(intf); - int open = 0; /* FIXME! iforce->dev.handle->open; */ usb_set_intfdata(intf, NULL); - if (iforce) { - iforce->usbdev = NULL; - input_unregister_device(iforce->dev); - if (!open) { - iforce_delete_device(iforce); - kfree(iforce); - } - } + input_unregister_device(iforce->dev); + + usb_free_urb(iforce->irq); + usb_free_urb(iforce->out); + usb_free_urb(iforce->ctrl); + + kfree(iforce); } static struct usb_device_id iforce_usb_ids [] = { |