diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c index c1bfa35d7a..5d6289df10 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c @@ -2,7 +2,7 @@ Virtual Memory Management Services to set or clear the memory encryption bit - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.
This program and the accompanying materials are licensed and made available @@ -596,6 +596,11 @@ SetMemoryEncDec ( BOOLEAN IsWpEnabled; RETURN_STATUS Status; + // + // Set PageMapLevel4Entry to suppress incorrect compiler/analyzer warnings. + // + PageMapLevel4Entry = NULL; + DEBUG (( DEBUG_VERBOSE, "%a:%a: Cr3Base=0x%Lx Physical=0x%Lx Length=0x%Lx Mode=%a CacheFlush=%u\n", diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c index 5559884345..95e42ef3dc 100644 --- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c +++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c @@ -11,7 +11,7 @@ synchronous requests and EFI_BLOCK_IO_PROTOCOL for now. Copyright (C) 2012, Red Hat, Inc. - Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Inc, All rights reserved.
This program and the accompanying materials are licensed and made available @@ -264,6 +264,13 @@ SynchronousRequest ( BlockSize = Dev->BlockIoMedia.BlockSize; + // + // Set BufferMapping and BufferDeviceAddress to suppress incorrect + // compiler/analyzer warnings. + // + BufferMapping = NULL; + BufferDeviceAddress = 0; + // // ensured by VirtioBlkInit() // diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c index 1a68f06210..e773ecf7cc 100644 --- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c +++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c @@ -26,7 +26,7 @@ unreasonable for now. Copyright (C) 2012, Red Hat, Inc. - Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Inc, All rights reserved.
This program and the accompanying materials are licensed and made available @@ -455,6 +455,15 @@ VirtioScsiPassThru ( UINTN InDataNumPages; BOOLEAN OutDataBufferIsMapped; + // + // Set InDataMapping,OutDataMapping,InDataDeviceAddress and OutDataDeviceAddress to + // suppress incorrect compiler/analyzer warnings. + // + InDataMapping = NULL; + OutDataMapping = NULL; + InDataDeviceAddress = 0; + OutDataDeviceAddress = 0; + ZeroMem ((VOID*) &Request, sizeof (Request)); Dev = VIRTIO_SCSI_FROM_PASS_THRU (This);