Merge "Get fastboot working on OS X"

This commit is contained in:
Elliott Hughes 2015-08-20 00:44:30 +00:00 committed by Gerrit Code Review
commit e728eb9150

View file

@ -293,6 +293,13 @@ static int try_device(io_service_t device, usb_handle *handle) {
// So, we have a device, finally. Grab its vitals.
kr = (*dev)->USBDeviceOpen(dev);
if (kr != 0) {
WARN("USBDeviceOpen");
goto out;
}
kr = (*dev)->GetDeviceVendor(dev, &handle->info.dev_vendor);
if (kr != 0) {
ERR("GetDeviceVendor");
@ -365,12 +372,16 @@ static int try_device(io_service_t device, usb_handle *handle) {
goto error;
}
out:
(*dev)->USBDeviceClose(dev);
(*dev)->Release(dev);
return 0;
error:
if (dev != NULL) {
(*dev)->USBDeviceClose(dev);
(*dev)->Release(dev);
}