mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
usb_device.c: release the usb interface on shutdown
Following the libusb documentaion: `You should release all claimed interfaces before closing a device handle.` https://libusb.sourceforge.io/api-1.0/group__libusb__dev.html libusb_release_interface() Change-Id: If916574314cd86fad3429065a11707da0a809e0d Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67072 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
parent
5903bb829d
commit
c0fdc9d108
@ -381,8 +381,11 @@ struct usb_device *usb_device_free(struct usb_device *device)
|
|||||||
{
|
{
|
||||||
struct usb_device *next = device->next;
|
struct usb_device *next = device->next;
|
||||||
|
|
||||||
if (device->handle != NULL)
|
if (device->handle != NULL) {
|
||||||
|
libusb_release_interface(device->handle,
|
||||||
|
device->interface_descriptor->bInterfaceNumber);
|
||||||
libusb_close(device->handle);
|
libusb_close(device->handle);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This unref balances the ref added in the add_device function.
|
* This unref balances the ref added in the add_device function.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user