File ovmf.ShellCommandRunDisconnect.patch of Package xen

From: Olaf Hering <olaf@aepfle.de>
Date: Tue, 20 Jun 2023 12:22:59 +0000
Subject: ShellCommandRunDisconnect
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

/home/abuild/rpmbuild/BUILD/xen-4.18.20230619T122059.42473bae/non-dbg/tools/firmware/ovmf-dir-remote/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c: In function ‘ShellCommandRunDisconnect’:
/home/abuild/rpmbuild/BUILD/xen-4.18.20230619T122059.42473bae/non-dbg/tools/firmware/ovmf-dir-remote/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c:190:20: error: ‘Handle3’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
           Status = gBS->DisconnectController (Handle1, Handle2, Handle3);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/abuild/rpmbuild/BUILD/xen-4.18.20230619T122059.42473bae/non-dbg/tools/firmware/ovmf-dir-remote/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c:184:52: error: ‘Handle2’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         } else if ((Handle2 != NULL) && EFI_ERROR (gBS->OpenProtocol (Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
                                                    ^~~
/home/abuild/rpmbuild/BUILD/xen-4.18.20230619T122059.42473bae/non-dbg/tools/firmware/ovmf-dir-remote/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c:175:42: error: ‘Handle1’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         if ((Param1 != NULL) && (Handle1 == NULL)) {
                                 ~~~~~~~~~^~~~~~~~

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
@@ -82,27 +82,27 @@ EFIAPI
 ShellCommandRunDisconnect (
   IN EFI_HANDLE        ImageHandle,
   IN EFI_SYSTEM_TABLE  *SystemTable
   )
 {
   EFI_STATUS    Status;
   LIST_ENTRY    *Package;
   CHAR16        *ProblemParam;
   SHELL_STATUS  ShellStatus;
   CONST CHAR16  *Param1;
   CONST CHAR16  *Param2;
   CONST CHAR16  *Param3;
-  EFI_HANDLE    Handle1;
-  EFI_HANDLE    Handle2;
-  EFI_HANDLE    Handle3;
+  EFI_HANDLE    Handle1 = NULL;
+  EFI_HANDLE    Handle2 = NULL;
+  EFI_HANDLE    Handle3 = NULL;
   UINT64        Intermediate1;
   UINT64        Intermediate2;
   UINT64        Intermediate3;
 
   ShellStatus = SHELL_SUCCESS;
 
   //
   // initialize the shell lib (we must be in non-auto-init...)
   //
   Status = ShellInitialize ();
   ASSERT_EFI_ERROR (Status);
 
openSUSE Build Service is sponsored by