aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-11-12 00:43:17 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-11-12 01:02:18 -0500
commit6ff92a6db2083ecd1a8e2742d9397159fd880987 (patch)
treef750917c819deb45b739cb74f9037122f8ce67ed /drivers/input/joystick
parent49cc69b6789b57d2d8ed78843c4219525b433b58 (diff)
Input: xpad - fix a memory leak
In xpad_led_disconnect(), what we really want is to kfree(xpad_led). In xpad_disconnect(), add a missing kfree(xpad->bdata) to fix the memory leak. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joystick')
-rw-r--r--drivers/input/joystick/xpad.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 39c0265ca156..e8b2ece3e01e 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -732,7 +732,7 @@ static void xpad_led_disconnect(struct usb_xpad *xpad)
732 732
733 if (xpad_led) { 733 if (xpad_led) {
734 led_classdev_unregister(&xpad_led->led_cdev); 734 led_classdev_unregister(&xpad_led->led_cdev);
735 kfree(xpad_led->name); 735 kfree(xpad_led);
736 } 736 }
737} 737}
738#else 738#else
@@ -921,7 +921,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
921 usb_set_intfdata(intf, xpad); 921 usb_set_intfdata(intf, xpad);
922 922
923 /* 923 /*
924 * Submit the int URB immediatly rather than waiting for open 924 * Submit the int URB immediately rather than waiting for open
925 * because we get status messages from the device whether 925 * because we get status messages from the device whether
926 * or not any controllers are attached. In fact, it's 926 * or not any controllers are attached. In fact, it's
927 * exactly the message that a controller has arrived that 927 * exactly the message that a controller has arrived that
@@ -1000,6 +1000,7 @@ static void xpad_disconnect(struct usb_interface *intf)
1000 usb_free_urb(xpad->irq_in); 1000 usb_free_urb(xpad->irq_in);
1001 usb_free_coherent(xpad->udev, XPAD_PKT_LEN, 1001 usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
1002 xpad->idata, xpad->idata_dma); 1002 xpad->idata, xpad->idata_dma);
1003 kfree(xpad->bdata);
1003 kfree(xpad); 1004 kfree(xpad);
1004 } 1005 }
1005} 1006}