]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
raise TPL to TPL_CALLBACK level at DriverBindingStart() for all usb-related modules...
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / PartitionDxe / Partition.c
index 73278e9c35bce2cf8e1ccb8217e92fc6538ffa21..5629a746560153b69ea6bbb8d7e4d8bca07a7cc9 100644 (file)
@@ -194,7 +194,9 @@ PartitionDriverBindingStart (
   EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
   PARTITION_DETECT_ROUTINE  *Routine;\r
   BOOLEAN                   MediaPresent;\r
+  EFI_TPL                   OldTpl;\r
 \r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK); \r
   //\r
   // Check RemainingDevicePath validation\r
   //\r
@@ -204,7 +206,8 @@ PartitionDriverBindingStart (
     // if yes, return EFI_SUCCESS\r
     //\r
     if (IsDevicePathEnd (RemainingDevicePath)) {\r
-      return EFI_SUCCESS;\r
+      Status = EFI_SUCCESS;\r
+      goto Exit;\r
     }\r
   }\r
 \r
@@ -217,7 +220,7 @@ PartitionDriverBindingStart (
                   EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    return Status;\r
+    goto Exit;\r
   }\r
   //\r
   // Get the Device Path Protocol on ControllerHandle's handle\r
@@ -231,7 +234,7 @@ PartitionDriverBindingStart (
                   EFI_OPEN_PROTOCOL_BY_DRIVER\r
                   );\r
   if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    return Status;\r
+    goto Exit;\r
   }\r
 \r
   Status = gBS->OpenProtocol (\r
@@ -249,7 +252,7 @@ PartitionDriverBindingStart (
           This->DriverBindingHandle,\r
           ControllerHandle\r
           );\r
-    return Status;\r
+    goto Exit;\r
   }\r
 \r
   OpenStatus = Status;\r
@@ -312,6 +315,8 @@ PartitionDriverBindingStart (
           );\r
   }\r
 \r
+Exit:\r
+  gBS->RestoreTPL (OldTpl);\r
   return Status;\r
 }\r
 \r