]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/FvSimpleFs: don't open DevicePath with BY_DRIVER mode
authorFeng Tian <feng.tian@intel.com>
Wed, 2 Mar 2016 01:45:06 +0000 (09:45 +0800)
committerFeng Tian <feng.tian@intel.com>
Thu, 3 Mar 2016 07:50:19 +0000 (15:50 +0800)
The device path protocol doesn't get closed at FvSimpleFilesystem
driver stop() when it's opened at start() with BY_DRIVER mode.

We change it to open DevicePath with GET_PROTOCOL mode as FV2 protocol with BY_DRIVER is enough.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c

index 975ab88ca1cf47df7d86212785530d3a19e1e92a..7167fb950b1ea36d849e1fb7754b1471993a0c31 100644 (file)
@@ -12,7 +12,7 @@
   from the UEFI shell. It is entirely read-only.\r
 \r
 Copyright (c) 2014, ARM Limited. All rights reserved.\r
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -452,9 +452,7 @@ FvSimpleFileSystemDriverStart (
   // Create an instance\r
   //\r
   Instance = AllocateZeroPool (sizeof (FV_FILESYSTEM_INSTANCE));\r
-  if (Instance == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
+  ASSERT (Instance != NULL);\r
 \r
   Instance->Root = NULL;\r
   Instance->FvProtocol = FvProtocol;\r
@@ -469,6 +467,7 @@ FvSimpleFileSystemDriverStart (
                   EFI_NATIVE_INTERFACE,\r
                   &Instance->SimpleFs\r
                   );\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
   // Decide on a filesystem volume label, which will include the FV's guid.\r
@@ -481,7 +480,7 @@ FvSimpleFileSystemDriverStart (
                    (VOID **) &FvDevicePath,\r
                    gImageHandle,\r
                    ControllerHandle,\r
-                   EFI_OPEN_PROTOCOL_BY_DRIVER\r
+                   EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                    );\r
   if (!EFI_ERROR (Status)) {\r
     //\r
@@ -528,7 +527,7 @@ FvSimpleFileSystemDriverStart (
                               );\r
   }\r
 \r
-  return Status;\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r