OpenBSD: Correctly catch attempts to do isochronous OUT transfers
authorPeter Stuge <peter@stuge.se>
Sun, 19 Feb 2012 04:32:10 +0000 (05:32 +0100)
committerPeter Stuge <peter@stuge.se>
Sun, 19 Feb 2012 04:32:10 +0000 (05:32 +0100)
LIBUSB_ENDPOINT_OUT is the value of the direction bit, which is 0 for
OUT transfers, so the previous condition could never evaluate to true.

libusb/os/openbsd_usb.c

index 2b0feb1..8306b46 100644 (file)
@@ -436,7 +436,7 @@ obsd_submit_transfer(struct usbi_transfer *itransfer)
                err = _sync_control_transfer(itransfer);
                break;
        case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
-               if (transfer->endpoint & LIBUSB_ENDPOINT_OUT) {
+               if (0 == transfer->endpoint & LIBUSB_ENDPOINT_IN) {
                        /* Isochronous write is not supported */
                        err = LIBUSB_ERROR_NOT_SUPPORTED;
                        break;