Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/67072 )
(
3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: usb_device.c: release the usb interface on shutdown ......................................................................
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 --- M usb_device.c 1 file changed, 24 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Edward O'Callaghan: Looks good to me, approved
diff --git a/usb_device.c b/usb_device.c index b23b204..b3c966c 100644 --- a/usb_device.c +++ b/usb_device.c @@ -381,8 +381,11 @@ { 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); + }
/* * This unref balances the ref added in the add_device function.