android_kernel_xiaomi_sm8350/drivers/hid/usbhid
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
..
hid-core.c USB HID: fix a possible NULL pointer dereference when we fail to allocate memory 2007-08-02 13:48:03 +02:00
hid-ff.c USB HID: add FF support for Logitech Force 3D Pro Joystick 2007-04-11 10:36:03 +02:00
hid-lgff.c HID: make debugging output runtime-configurable 2007-07-09 14:03:35 +02:00
hid-pidff.c HID: fix autocentering of PID devices 2007-07-09 14:13:35 +02:00
hid-plff.c HID: switch to using input_dev->dev.parent 2007-05-09 10:17:31 +02:00
hid-quirks.c USB HID: add ASUS LCM to the blacklist 2007-08-02 13:48:03 +02:00
hid-tmff.c HID: make debugging output runtime-configurable 2007-07-09 14:03:35 +02:00
hid-zpff.c HID: make debugging output runtime-configurable 2007-07-09 14:03:35 +02:00
hiddev.c HID: make debugging output runtime-configurable 2007-07-09 14:03:35 +02:00
Kconfig USB HID: update CONFIG_USB_HIDINPUT_POWERBOOK description 2007-05-09 02:52:51 +02:00
Makefile USB HID: encapsulate quirk handling into hid-quirks.c 2007-04-19 13:27:04 +02:00
usbhid.h
usbkbd.c HID: make debugging output runtime-configurable 2007-07-09 14:03:35 +02:00
usbmouse.c HID: switch to using input_dev->dev.parent 2007-05-09 10:17:31 +02:00