Skip to content

Commit c48f1cf

Browse files
committed
usb: libusb: hub_controller: Fix PnP handler
In some cases our driver was changing IRP status in places where it shouldn't. svn path=/branches/GSoC_2016/USB/; revision=72378
1 parent f07098a commit c48f1cf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sdk/lib/drivers/libusb/hub_controller.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,8 @@ CHubController::HandlePnp(
568568
break;
569569
}
570570
}
571-
Status = STATUS_SUCCESS;
571+
// Here we should leave Status as is.
572+
Status = Irp->IoStatus.Status;
572573
break;
573574
}
574575
case IRP_MN_QUERY_CAPABILITIES:
@@ -611,6 +612,14 @@ CHubController::HandlePnp(
611612
// handle device interface requests
612613
//
613614
Status = HandleQueryInterface(IoStack);
615+
616+
//
617+
// If a bus driver does not export the requested interface, it
618+
// should leave Status as is.
619+
//
620+
if (Status == STATUS_NOT_SUPPORTED)
621+
Status = Irp->IoStatus.Status;
622+
614623
break;
615624
}
616625
case IRP_MN_REMOVE_DEVICE:

0 commit comments

Comments
 (0)