]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UdfDxe: don't return unset Status if INLINE_DATA req succeeds
authorLaszlo Ersek <lersek@redhat.com>
Sat, 9 Sep 2017 21:11:41 +0000 (23:11 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 12 Sep 2017 10:12:24 +0000 (12:12 +0200)
Ard reports that clang-3.8 correctly flags the following issue in the
ReadFile() function:

If "RecordingFlags" is INLINE_DATA, then there are three paths through the
code where we mean to return success, but forget to set Status
accordingly:

(1) when "ReadFileInfo->Flags" is READ_FILE_GET_FILESIZE, or

(2) when "ReadFileInfo->Flags" is READ_FILE_ALLOCATE_AND_READ and
    AllocatePool() succeeds, or

(3) when "ReadFileInfo->Flags" is READ_FILE_SEEK_AND_READ.

Set "Status" to EFI_SUCCESS when we are done processing the INLINE_DATA
request, i.e., when we reach the corresponding "break" statament under the
INLINE_DATA case label.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Paulo Alcantara <pcacjr@zytor.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c

index 842c7f8f090adbbd6f7b2d56c12adcf3b011aee7..72862653738e5c87d0a30a919ef6e9e276077f76 100644 (file)
@@ -967,7 +967,9 @@ ReadFile (
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
+    Status = EFI_SUCCESS;\r
     break;\r
+\r
   case LONG_ADS_SEQUENCE:\r
   case SHORT_ADS_SEQUENCE:\r
     //\r