Skip to content

Commit

Permalink
Only claim interface if the open was successful
Browse files Browse the repository at this point in the history
  • Loading branch information
martonmiklos committed Jan 15, 2025
1 parent d539ab2 commit fcfd7c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/stlink_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ STLinkInterface::STLink_OpenDevice(TEnumStlinkInterface IfId,
libusb_device *dev = devices[DevIdxInList];
libusb_device_handle *handle = nullptr;
int ret = libusb_open(dev, &handle);
libusb_claim_interface(handle, 4);
if (LIBUSB_SUCCESS == ret) {
libusb_claim_interface(handle, 4);
*pHandle = handle;
return SS_OK;
}
Expand Down

0 comments on commit fcfd7c2

Please sign in to comment.