File ovmf.CoreOpenProtocol.patch of Package xen
From: Olaf Hering <olaf@aepfle.de>
Date: Tue, 20 Jun 2023 19:29:35 +0000
Subject: CoreOpenProtocol
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/MdeModulePkg/Core/Dxe/Hand/Handle.c: In function ‘CoreOpenProtocol’:
/home/abuild/rpmbuild/BUILD/xen-4.18.20230619T122059.42473bae/non-dbg/tools/firmware/ovmf-dir-remote/MdeModulePkg/Core/Dxe/Hand/Handle.c:1183:24: error: ‘Prot’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
*Interface = Prot->Interface;
~~~~^~~~~~~~~~~
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
MdeModulePkg/Core/Dxe/Hand/Handle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/MdeModulePkg/Core/Dxe/Hand/Handle.c
+++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c
@@ -957,25 +957,25 @@ CoreHandleProtocol (
EFI_STATUS
EFIAPI
CoreOpenProtocol (
IN EFI_HANDLE UserHandle,
IN EFI_GUID *Protocol,
OUT VOID **Interface OPTIONAL,
IN EFI_HANDLE ImageHandle,
IN EFI_HANDLE ControllerHandle,
IN UINT32 Attributes
)
{
EFI_STATUS Status;
- PROTOCOL_INTERFACE *Prot;
+ PROTOCOL_INTERFACE *Prot = NULL;
LIST_ENTRY *Link;
OPEN_PROTOCOL_DATA *OpenData;
BOOLEAN ByDriver;
BOOLEAN Exclusive;
BOOLEAN Disconnect;
BOOLEAN ExactMatch;
//
// Check for invalid Protocol
//
if (Protocol == NULL) {
return EFI_INVALID_PARAMETER;