Revision: 14341
          http://edk2.svn.sourceforge.net/edk2/?rev=14341&view=rev
Author:   vanjeff
Date:     2013-05-10 07:10:38 +0000 (Fri, 10 May 2013)
Log Message:
-----------
Sync patch r14338 and r14339 from main trunk.
1. MdeMdeModulePkg/UsbBusDxe: Break device enumeration process if the device 
descriptor includes 0 configuration.
2. MdeMdeModulePkg/Xhci: Clear BIOS_OWN semaphore before halting XHCI 
controller.

Revision Links:
--------------
    http://edk2.svn.sourceforge.net/edk2/?rev=14338&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14339&view=rev

Modified Paths:
--------------
    branches/UDK2010.SR1/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
    branches/UDK2010.SR1/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c

Modified: branches/UDK2010.SR1/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c    2013-05-10 
06:46:20 UTC (rev 14340)
+++ branches/UDK2010.SR1/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c    2013-05-10 
07:10:38 UTC (rev 14341)
@@ -1801,23 +1801,23 @@
   XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
 
   if (Xhc->PollTimer != NULL) {
-    gBS->CloseEvent (Xhc->PollTimer);
-  }
-
-  //
-  // Restore original PCI attributes
-  //
+    gBS->CloseEvent (Xhc->PollTimer);
+  }
+
+  XhcClearBiosOwnership (Xhc);
+
+  //
+  // Restore original PCI attributes
+  //
   PciIo->Attributes (
                   PciIo,
                   EfiPciIoAttributeOperationSet,
-                  Xhc->OriginalPciAttributes,
-                  NULL
-                  );
-
-  XhcClearBiosOwnership (Xhc);
-}
-
-/**
+                  Xhc->OriginalPciAttributes,
+                  NULL
+                  );
+}
+
+/**
   Starting the Usb XHCI Driver.
 
   @param  This                 Protocol instance pointer.

Modified: branches/UDK2010.SR1/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c       
2013-05-10 06:46:20 UTC (rev 14340)
+++ branches/UDK2010.SR1/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c       
2013-05-10 07:10:38 UTC (rev 14341)
@@ -786,10 +786,13 @@
     return Status;
   }
 
-  DevDesc          = UsbDev->DevDesc;
-  NumConfig        = DevDesc->Desc.NumConfigurations;
+  DevDesc   = UsbDev->DevDesc;
+  NumConfig = DevDesc->Desc.NumConfigurations;
+  if (NumConfig == 0) {
+    return EFI_DEVICE_ERROR;
+  }
+
   DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *));
-
   if (DevDesc->Configs == NULL) {
     return EFI_OUT_OF_RESOURCES;
   }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to