diff --git a/gnu-efi-3.0/lib/event.c b/gnu-efi-3.0/lib/event.c index 0babc92..faebf03 100644 --- a/gnu-efi-3.0/lib/event.c +++ b/gnu-efi-3.0/lib/event.c @@ -57,7 +57,10 @@ LibCreateProtocolNotifyEvent ( Event, Registration ); - if ( EFI_ERROR( Status ) ) return NULL ; + if ( EFI_ERROR( Status ) ) { + uefi_call_wrapper(BS->CloseEvent, 1, Event); + return NULL ; + } ASSERT (!EFI_ERROR(Status)); // diff --git a/gnu-efi-3.0/lib/hw.c b/gnu-efi-3.0/lib/hw.c index 09a77f9..bbefdc5 100644 --- a/gnu-efi-3.0/lib/hw.c +++ b/gnu-efi-3.0/lib/hw.c @@ -75,7 +75,7 @@ ReadPort ( IN UINTN Port ) { - UINT32 Data; + UINT32 Data = 0; EFI_STATUS Status EFI_UNUSED; Status = uefi_call_wrapper(GlobalIoFncs->Io.Read, 5, GlobalIoFncs, Width, (UINT64)Port, 1, &Data); @@ -105,7 +105,7 @@ ReadPciConfig ( IN UINTN Address ) { - UINT32 Data; + UINT32 Data = 0; EFI_STATUS Status EFI_UNUSED; Status = uefi_call_wrapper(GlobalIoFncs->Pci.Read, 5, GlobalIoFncs, Width, (UINT64)Address, 1, &Data); diff --git a/gnu-efi-3.0/lib/print.c b/gnu-efi-3.0/lib/print.c index 35e43c0..9e79d97 100644 --- a/gnu-efi-3.0/lib/print.c +++ b/gnu-efi-3.0/lib/print.c @@ -1433,7 +1433,7 @@ DumpHex ( CHAR8 *Data, Val[50], Str[20], c; UINTN Size, Index; - UINTN ScreenCount; + UINTN ScreenCount = 0; // Avoid variable being unitialized UINTN TempColumn; UINTN ScreenSize; CHAR16 ReturnStr[1];