Skip to content

Commit

Permalink
HID: Never call hid_free_buffers() when usbhid_device has been freed
Browse files Browse the repository at this point in the history
We can't call hid_free_buffers() when the underlying usbhid_device
has already been freed.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Kosina committed Aug 2, 2007
1 parent cda5ecf commit 22f675f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hid/usbhid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,9 +877,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 22f675f

Please sign in to comment.