]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/EnhancedFatDxe/Info.c
EFI_FILE_PROTOCOL spec conformance bug fix.
[mirror_edk2.git] / FatPkg / EnhancedFatDxe / Info.c
index ae85cce85976096ce3300142275485572e2d8040..858b3f4a3e00a12b8a48ac7aff7f42f3e0ce4f88 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available\r
 under the terms and conditions of the BSD License which accompanies this\r
 distribution. The full text of the license may be found at\r
@@ -528,20 +528,16 @@ Returns:
     //\r
     Status = EFI_UNSUPPORTED;\r
     if (IsSet) {\r
-      if (Volume->ReadOnly) {\r
-        Status = EFI_WRITE_PROTECTED;\r
-      } else {\r
-        if (CompareGuid (Type, &gEfiFileInfoGuid)) {\r
-          Status = FatSetFileInfo (Volume, IFile, OFile, *BufferSize, Buffer);\r
-        }\r
+      if (CompareGuid (Type, &gEfiFileInfoGuid)) {\r
+        Status = Volume->ReadOnly ? EFI_WRITE_PROTECTED : FatSetFileInfo (Volume, IFile, OFile, *BufferSize, Buffer);\r
+      }\r
 \r
-        if (CompareGuid (Type, &gEfiFileSystemInfoGuid)) {\r
-          Status = FatSetVolumeInfo (Volume, *BufferSize, Buffer);\r
-        }\r
+      if (CompareGuid (Type, &gEfiFileSystemInfoGuid)) {\r
+        Status = Volume->ReadOnly ? EFI_WRITE_PROTECTED : FatSetVolumeInfo (Volume, *BufferSize, Buffer);\r
+      }\r
 \r
-        if (CompareGuid (Type, &gEfiFileSystemVolumeLabelInfoIdGuid)) {\r
-          Status = FatSetVolumeLabelInfo (Volume, *BufferSize, Buffer);\r
-        }\r
+      if (CompareGuid (Type, &gEfiFileSystemVolumeLabelInfoIdGuid)) {\r
+        Status = Volume->ReadOnly ? EFI_WRITE_PROTECTED : FatSetVolumeLabelInfo (Volume, *BufferSize, Buffer);\r
       }\r
     } else {\r
       if (CompareGuid (Type, &gEfiFileInfoGuid)) {\r