提交 cda5ecf8 编写于 作者: J Jiri Kosina

USB HID: fix memory leak of usbhid_device

Add forgotten freeing of usbhid_device structure.
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 de1a7b03
......@@ -877,6 +877,7 @@ 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);
kfree(usbhid);
fail_no_usbhid:
hid_free_buffers(dev, hid);
hid_free_device(hid);
......@@ -912,6 +913,7 @@ 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);
hid_free_device(hid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册