]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c
EmulatorPkg: IoThunk->Close() is called too early, may causing hang
[mirror_edk2.git] / EmulatorPkg / EmuSimpleFileSystemDxe / EmuSimpleFileSystem.c
index b5e19bb840a38d9eff1c7fa0cecf7d1b2fe105e3..28abfd6beff74de78b7807a86a200efb0a0a846c 100644 (file)
@@ -866,7 +866,6 @@ EmuSimpleFileSystemDriverBindingStop (
   }\r
 \r
   Private = EMU_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (SimpleFileSystem);\r
-  Status = Private->IoThunk->Close (Private->IoThunk);\r
 \r
   //\r
   // Uninstall the Simple File System Protocol from ControllerHandle\r
@@ -883,9 +882,12 @@ EmuSimpleFileSystemDriverBindingStop (
                     This->DriverBindingHandle,\r
                     ControllerHandle\r
                     );\r
-  }\r
-\r
-  if (!EFI_ERROR (Status)) {\r
+    ASSERT_EFI_ERROR (Status);\r
+    //\r
+    // Destroy the IO interface.\r
+    //\r
+    Status = Private->IoThunk->Close (Private->IoThunk);\r
+    ASSERT_EFI_ERROR (Status);\r
     //\r
     // Free our instance data\r
     //\r