From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.6022.1616719356171152680 for ; Thu, 25 Mar 2021 17:42:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=Gvyt4Vb3; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 62EAC20B5680; Thu, 25 Mar 2021 17:42:35 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 62EAC20B5680 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1616719355; bh=p7UYKgAReek1Iz7BGn+uJ/7oaMXMZjCLCIGGH3bkb8g=; h=From:To:Cc:Subject:Date:From; b=Gvyt4Vb31W7Qb87iuo3KxPOQPX4H689jjeejUMOD47BZcDB4EOnGJA50CY7bKxMsY ufD0p6AMRuauokDdT+YkPGOoekJqkvURDxj2QFdGUYNj9eMr/Dm0VSlCTP1L5B2313 vejKxIU7rh4v4ZMa9c6ACbeyNzpwhGfh7byaxVjc= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Qi Zhang , Rahul Kumar , Kun Qin Subject: [PATCH v1 1/1] SecurityPkg/Tcg2Smm: Initialize local Status variable Date: Thu, 25 Mar 2021 17:42:10 -0700 Message-Id: <20210326004210.1305-1-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3277 Initializes the Status variable in TcgMmReadyToLock(). Fixes a Clang build failure: Tcg2Smm.c - SecurityPkg\Tcg\Tcg2Smm\Tcg2Smm.c:254:7: error: variable 'Status' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] Cc: Jiewen Yao Cc: Jian J Wang Cc: Qi Zhang Cc: Rahul Kumar Cc: Kun Qin Signed-off-by: Michael Kubacki --- SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/= Tcg2Smm.c index 589c08794bcf..f49eccb0bdf4 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -253,6 +253,8 @@ TcgMmReadyToLock ( { EFI_STATUS Status; =20 + Status =3D EFI_SUCCESS; + if (mReadyToLockHandle !=3D NULL) { Status =3D gMmst->MmiHandlerUnRegister (mReadyToLockHandle); mReadyToLockHandle =3D NULL; --=20 2.28.0.windows.1