Changeset cfce4d127184f4e4f334976151a0f80594bb5e22 in libusb
- Timestamp:
- 02/15/10 21:10:08 (7 months ago)
- Children:
- 68af9f8d731f700267335941a8214d34ab518cc8
- Parents:
- 161893cfbefefe315f657677705abe090fc526f2
- git-author:
- Nathan Hjelm <hjelmn@mac.com> / 2010-02-15T14:10:08Z-0600
- git-committer:
- Daniel Drake <dan@reactivated.net> / 2010-02-15T14:10:08Z-0600
- File:
-
- 1 edited
-
libusb/os/darwin_usb.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libusb/os/darwin_usb.c
r161893 rcfce4d 442 442 UInt8 bDeviceClass, bDeviceSubClass; 443 443 IOUSBDevRequest req; 444 int ret ;444 int ret, need_unref = 0; 445 445 446 446 dev = usbi_get_device_by_session_id(ctx, locationID); 447 447 if (!dev) { 448 _usbi_log (ctx, LOG_LEVEL_INFO, "allocating new device for location 0x%08x", locationID);448 usbi_info (ctx, "allocating new device for location 0x%08x", locationID); 449 449 dev = usbi_alloc_device(ctx, locationID); 450 need_unref = 1; 450 451 if (!dev) 451 452 return LIBUSB_ERROR_NO_MEM; … … 498 499 499 500 if (ret != kIOReturnSuccess) { 500 _usbi_log (ctx, LOG_LEVEL_WARNING, "could not retrieve device descriptor: %s. skipping device", darwin_error_str (ret)); 501 libusb_unref_device(dev); 501 usbi_warn (ctx, "could not retrieve device descriptor: %s. skipping device", darwin_error_str (ret)); 502 if (need_unref) 503 libusb_unref_device(dev); 502 504 return -1; 503 505 } … … 523 525 524 526 if (ret < 0) { 525 libusb_unref_device(dev); 527 if (need_unref) 528 libusb_unref_device(dev); 526 529 return -1; 527 530 } … … 529 532 priv = (struct darwin_device_priv *)dev->os_priv; 530 533 531 _usbi_log (ctx, LOG_LEVEL_INFO, "using existing device for location 0x%08x", locationID);534 usbi_info (ctx, "using existing device for location 0x%08x", locationID); 532 535 } 533 536 … … 539 542 *_discdevs = discdevs; 540 543 541 _usbi_log (ctx, LOG_LEVEL_INFO, "found device with address %d at %s", dev->device_address, priv->sys_path); 542 544 usbi_info (ctx, "found device with address %d at %s", dev->device_address, priv->sys_path); 545 546 if (need_unref) 547 libusb_unref_device(dev); 548 543 549 return 0; 544 550 }
Note: See TracChangeset
for help on using the changeset viewer.