Files
linux/drivers
Jesper Juhl de1a7b0328 USB HID: fix a possible NULL pointer dereference when we fail to allocate memory
If, in usb_hid_configure(), we fail to allocate storage for 'usbhid',
 "if (!(usbhid = kzalloc(sizeof(struct usbhid_device), GFP_KERNEL)))",
then we'll jump to the 'fail:' label where we have this code:
        usb_free_urb(usbhid->urbin);
        usb_free_urb(usbhid->urbout);
        usb_free_urb(usbhid->urbctrl);
Since we got here because we couldn't allocate storage for 'usbhid',
what we have here is a NULL pointer dereference - ouch...

This patch solves that little problem by adding a new
'fail_no_usbhid:' label after the problematic calls to
usb_free_urb() and jumps to that one instead, in the problem case.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-08-02 13:48:03 +02:00
..
2007-07-31 15:39:39 -07:00
2007-07-18 02:13:42 -07:00
2007-07-31 15:39:39 -07:00
2007-07-31 15:39:43 -07:00
2007-07-21 18:37:12 -07:00
2007-07-16 09:05:40 -07:00
2007-07-16 09:05:42 -07:00
2007-07-30 21:14:00 -04:00
2007-08-01 23:46:46 +02:00
2007-07-26 11:11:57 -07:00
2007-07-31 15:39:40 -07:00
2007-07-20 14:25:51 +10:00
2007-07-31 15:39:37 -07:00
2007-07-29 16:53:59 -07:00
2007-06-28 19:19:20 +10:00
2007-07-31 15:39:44 -07:00
2007-07-31 15:39:42 -07:00
2007-07-18 08:38:22 -07:00
2007-07-18 15:57:16 -07:00
2007-07-31 15:39:41 -07:00
2007-07-26 11:11:57 -07:00
2007-07-26 11:35:17 -07:00
2007-07-20 13:39:59 +10:00
2007-07-29 18:58:39 +00:00