From 998ebe5ca0ae5c449e83ede533bee872f97d63af Mon Sep 17 00:00:00 2001 From: Min M Xu Date: Wed, 18 Jan 2023 07:53:01 +0800 Subject: OvmfPkg/CcExitLib: Initialize Status in IoExit Status should be initialized otherwise it may return unexpected value. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Cc: Michael Roth Reviewed-by: Jiewen Yao Signed-off-by: Min Xu --- OvmfPkg/Library/CcExitLib/CcExitVeHandler.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c index b8979ec2c0..2c1de0039d 100644 --- a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c +++ b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c @@ -109,10 +109,11 @@ IoExit ( UINT64 RepCnt; UINT64 Status; - Val = 0; - Write = Veinfo->ExitQualification.Io.Direction ? FALSE : TRUE; - Size = Veinfo->ExitQualification.Io.Size + 1; - Port = Veinfo->ExitQualification.Io.Port; + Val = 0; + Status = 0; + Write = Veinfo->ExitQualification.Io.Direction ? FALSE : TRUE; + Size = Veinfo->ExitQualification.Io.Size + 1; + Port = Veinfo->ExitQualification.Io.Port; if (Veinfo->ExitQualification.Io.String) { // -- cgit v1.2.3