MdeModulePkg/UdfDxe: don't return unset Status if INLINE_DATA req succeeds
authorLaszlo Ersek <>
Sat, 9 Sep 2017 21:11:41 +0000 (23:11 +0200)
committerLaszlo Ersek <>
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

(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 <>
Cc: Eric Dong <>
Cc: Paulo Alcantara <>
Cc: Ruiyu Ni <>
Cc: Star Zeng <>
Reported-by: Ard Biesheuvel <>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <>
Reviewed-by: Star Zeng <>
Reviewed-by: Paulo Alcantara <>
Reviewed-by: Ard Biesheuvel <>

index 842c7f8f090adbbd6f7b2d56c12adcf3b011aee7..72862653738e5c87d0a30a919ef6e9e276077f76 100644 (file)
@@ -967,7 +967,9 @@ ReadFile (
       return EFI_INVALID_PARAMETER;\r
+    Status = EFI_SUCCESS;\r