Commit 22f675f3 authored by Jiri Kosina's avatar Jiri Kosina

HID: Never call hid_free_buffers() when usbhid_device has been freed

We can't call hid_free_buffers() when the underlying usbhid_device
has already been freed.
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent cda5ecf8
......@@ -877,9 +877,9 @@ fail:
usb_free_urb(usbhid->urbin);
usb_free_urb(usbhid->urbout);
usb_free_urb(usbhid->urbctrl);
hid_free_buffers(dev, hid);
kfree(usbhid);
fail_no_usbhid:
hid_free_buffers(dev, hid);
hid_free_device(hid);
return NULL;
......@@ -913,9 +913,9 @@ static void hid_disconnect(struct usb_interface *intf)
usb_free_urb(usbhid->urbin);
usb_free_urb(usbhid->urbctrl);
usb_free_urb(usbhid->urbout);
kfree(usbhid);
hid_free_buffers(hid_to_usb_dev(hid), hid);
kfree(usbhid);
hid_free_device(hid);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment