--- libusb10_io.c +++ libusb10_io.c @@ -583,7 +577,8 @@ libusb_context *ctx; int ret; - ctx = GET_CONTEXT(NULL); + ctx = libusb_get_device(devh)->ctx; + ctx = GET_CONTEXT(ctx); DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, @@ -601,7 +596,8 @@ libusb_context *ctx; int ret; - ctx = GET_CONTEXT(NULL); + ctx = libusb_get_device(devh)->ctx; + ctx = GET_CONTEXT(ctx); DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred,