]> git.proxmox.com Git - mirror_edk2.git/commit - OvmfPkg/VirtioBlkDxe/VirtioBlk.c
OvmfPkg:Fix VS2012 build failure
authorDandan Bi <dandan.bi@intel.com>
Fri, 23 Mar 2018 03:21:56 +0000 (11:21 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 28 Mar 2018 01:58:49 +0000 (09:58 +0800)
commit699a2c30cb6e74a55f0c3f67c376460f99c201ed
tree039d4be3c443f3cd721f2b39d8c5d5f9bfe43d30
parentd1b777440bc616f1e6da9204f3eec9f7a5a6f2e2
OvmfPkg:Fix VS2012 build failure

Initialize local variable to suppress warning C4701/C4703:
potentially uninitialized local variable/pointer variable.

1.In VirtualMemory.c:
Read of "PageMapLevel4Entry" in SetMemoryEncDe() is only
reached when "PageMapLevel4Entry" is got correctly.

2.In VirtioBlk.c:
Reads (dereferences) of "BufferMapping" and "BufferDeviceAddress"
in SynchronousRequest() are only reached if "BufferSize > 0" *and*
we map the data buffer successfully.

3.In VirtioScsi.c:
Reads (dereferences) of "InDataMapping" and "InDataDeviceAddress",
in VirtioScsiPassThru() are only reached if
"Packet->InTransferLength > 0" on input, *and* we map the
input buffer successfully. The similar reason for "OutDataMapping"
and "OutDataDeviceAddress".

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c
OvmfPkg/VirtioBlkDxe/VirtioBlk.c
OvmfPkg/VirtioScsiDxe/VirtioScsi.c