summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.c')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.c
index c5a0604fca..096b10a831 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.c
@@ -645,11 +645,16 @@ UsbIoGetEndpointDescriptor (
UsbIf = USB_INTERFACE_FROM_USBIO (This);
- if ((Descriptor == NULL) || (Index >= UsbIf->IfSetting->Desc.NumEndpoints)) {
+ if ((Descriptor == NULL) || (Index > 15)) {
gBS->RestoreTPL (OldTpl);
return EFI_INVALID_PARAMETER;
}
+ if (Index >= UsbIf->IfSetting->Desc.NumEndpoints) {
+ gBS->RestoreTPL (OldTpl);
+ return EFI_NOT_FOUND;
+ }
+
CopyMem (
Descriptor,
&(UsbIf->IfSetting->Endpoints[Index]->Desc),
@@ -813,6 +818,11 @@ UsbIoPortReset (
UsbIf = USB_INTERFACE_FROM_USBIO (This);
Dev = UsbIf->Device;
+ if (UsbIf->IsHub == TRUE) {
+ Status = EFI_INVALID_PARAMETER;
+ goto ON_EXIT;
+ }
+
HubIf = Dev->ParentIf;
Status = HubIf->HubApi->ResetPort (HubIf, Dev->ParentPort);
@@ -875,7 +885,6 @@ EFI_USB_IO_PROTOCOL mUsbIoProtocol = {
UsbIoPortReset
};
-//@MT: EFI_DRIVER_ENTRY_POINT (UsbBusDriverEntryPoint)
EFI_STATUS
EFIAPI