Thomas Heijligen submitted this change.

View Change



3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: build bot (Jenkins): Verified Edward O'Callaghan: Looks good to me, approved
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(-)

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.

To view, visit change 67072. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If916574314cd86fad3429065a11707da0a809e0d
Gerrit-Change-Number: 67072
Gerrit-PatchSet: 5
Gerrit-Owner: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged