summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_transfer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/usb_transfer.c')
-rw-r--r--sys/dev/usb/usb_transfer.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c
index d4efaff..b0aba0f 100644
--- a/sys/dev/usb/usb_transfer.c
+++ b/sys/dev/usb/usb_transfer.c
@@ -1376,14 +1376,6 @@ usb2_start_hardware(struct usb2_xfer *xfer)
xfer, xfer->pipe, xfer->nframes, USB_GET_DATA_ISREAD(xfer) ?
"read" : "write");
- /* Check if the device is still alive */
- if (info->udev->state < USB_STATE_POWERED) {
- USB_BUS_LOCK(bus);
- usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED);
- USB_BUS_UNLOCK(bus);
- return;
- }
-
#if USB_DEBUG
if (USB_DEBUG_VAR > 0) {
USB_BUS_LOCK(bus);
@@ -1444,8 +1436,15 @@ usb2_start_hardware(struct usb2_xfer *xfer)
/* clear any previous errors */
xfer->error = 0;
- /* sanity check */
+ /* Check if the device is still alive */
+ if (info->udev->state < USB_STATE_POWERED) {
+ USB_BUS_LOCK(bus);
+ usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED);
+ USB_BUS_UNLOCK(bus);
+ return;
+ }
+ /* sanity check */
if (xfer->nframes == 0) {
if (xfer->flags.stall_pipe) {
/*
OpenPOWER on IntegriCloud