audk/OvmfPkg/LinuxInitrdDynamicShellCommand
Ard Biesheuvel 6c6fef0247 OvmfPkg/LinuxInitrdDynamicShellCommand: fix uninitialized status return
The Linaro CI reports:

  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c:132:7:
  error: variable 'Status' is used uninitialized whenever 'if' condition is
                false [-Werror,-Wsometimes-uninitialized]
    if (mInitrdLoadFile2Handle != NULL) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c:141:10:
  note: uninitialized use occurs here
    return Status;
           ^~~~~~
  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c:132:3:
  note: remove the 'if' if its condition is always true
    if (mInitrdLoadFile2Handle != NULL) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c:130:23:
  note: initialize the variable 'Status' to silence this warning
    EFI_STATUS    Status;
                      ^
                       = 0

Fix this by pulling the return of Status into the conditional block where
it is assigned, and return EFI_SUCCESS otherwise.

Fixes: 2632178bc6
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2020-03-04 17:42:43 +00:00
..
LinuxInitrdDynamicShellCommand.c OvmfPkg/LinuxInitrdDynamicShellCommand: fix uninitialized status return 2020-03-04 17:42:43 +00:00
LinuxInitrdDynamicShellCommand.inf
LinuxInitrdDynamicShellCommand.uni OvmfPkg/LinuxInitrdDynamicShellCommand: bail if initrd already exists 2020-03-04 09:26:45 +00:00