summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libusb/os/darwin_usb.c29
-rw-r--r--libusb/version_nano.h2
2 files changed, 15 insertions, 16 deletions
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c
index 319289b..5d31088 100644
--- a/libusb/os/darwin_usb.c
+++ b/libusb/os/darwin_usb.c
@@ -2439,22 +2439,21 @@ static int darwin_detach_kernel_driver (struct libusb_device_handle *dev_handle,
if (dpriv->capture_count == 0) {
usbi_dbg (ctx, "attempting to detach kernel driver from device");
- if (!darwin_has_capture_entitlements ()) {
- usbi_info (ctx, "no capture entitlements. can not detach the kernel driver for this device");
- return LIBUSB_ERROR_NOT_SUPPORTED;
- }
-
- /* request authorization */
- kresult = IOServiceAuthorize (dpriv->service, kIOServiceInteractionAllowed);
- if (kresult != kIOReturnSuccess) {
- usbi_warn (ctx, "IOServiceAuthorize: %s", darwin_error_str(kresult));
- return darwin_to_libusb (kresult);
- }
+ if (darwin_has_capture_entitlements ()) {
+ /* request authorization */
+ kresult = IOServiceAuthorize (dpriv->service, kIOServiceInteractionAllowed);
+ if (kresult != kIOReturnSuccess) {
+ usbi_warn (ctx, "IOServiceAuthorize: %s", darwin_error_str(kresult));
+ return darwin_to_libusb (kresult);
+ }
- /* we need start() to be called again for authorization status to refresh */
- err = darwin_reload_device (dev_handle);
- if (err != LIBUSB_SUCCESS) {
- return err;
+ /* we need start() to be called again for authorization status to refresh */
+ err = darwin_reload_device (dev_handle);
+ if (err != LIBUSB_SUCCESS) {
+ return err;
+ }
+ } else {
+ usbi_info (ctx, "no capture entitlements. may not be able to detach the kernel driver for this device");
}
/* reset device to release existing drivers */
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 94aba9b..981f704 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11647
+#define LIBUSB_NANO 11648