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.web08.854.1618250063168534093 for ; Mon, 12 Apr 2021 10:54:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=RkOgZ6RN; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [10.124.238.202] (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 78D6E20B8000; Mon, 12 Apr 2021 10:54:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 78D6E20B8000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1618250062; bh=mL1YV84q0ERhIUMzeeWoa8uC4im6mQPA035BqgJieXU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=RkOgZ6RNnqCid7KyNdlozUGkmH91NqvYx44DnF1W0hu2tT8iMqG5dqs9ZDRZ19B3v /zOIeiJzLsmGys+F46+skgWLc1jqbGl1hR6esad4agyIRRvOIJfreaYqXUFqa0xDBg X4uzxi5KEQfE/ArXpijZEo7vxHb+Evwgyi15HQUE= Subject: Re: [edk2-devel] [PATCH v2 1/1] SecurityPkg/Tcg2Smm: Initialize local Status variable To: devel@edk2.groups.io, lersek@redhat.com Cc: Jiewen Yao , Jian J Wang , Qi Zhang , Rahul Kumar , Kun Qin References: <20210406181207.8731-1-mikuback@linux.microsoft.com> <2e577197-2381-4849-f4db-4e2f992cae66@redhat.com> From: "Michael Kubacki" Message-ID: <8aa2a8ff-06b9-6efe-46cd-7e987adc2b90@linux.microsoft.com> Date: Mon, 12 Apr 2021 10:54:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <2e577197-2381-4849-f4db-4e2f992cae66@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Laszlo and SecurityPkg maintainers, This is a relatively straightforward patch. Please let me know if anything else is needed for you to submit it. Thanks, Michael On 4/7/2021 9:06 AM, Laszlo Ersek wrote: > On 04/06/21 20:12, mikuback@linux.microsoft.com wrote: >> From: Michael Kubacki >> >> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3277 >> >> 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] >> >> Initializing this variable is required to address a practical >> scenario in which the return value of TcgMmReadyToLock() is >> undefined based on conditional evaluation in the function. >> >> Cc: Jiewen Yao >> Cc: Jian J Wang >> Cc: Qi Zhang >> Cc: Rahul Kumar >> Cc: Kun Qin >> Signed-off-by: Michael Kubacki >> Reviewed-by: Jiewen Yao >> --- >> >> Notes: >> V2 change: >> >> Clarify in commit message that the issue reported by Clang is not >> solely a false positive. >> >> 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; >> >> + Status = EFI_SUCCESS; >> + >> if (mReadyToLockHandle != NULL) { >> Status = gMmst->MmiHandlerUnRegister (mReadyToLockHandle); >> mReadyToLockHandle = NULL; >> > > Awesome, thanks! > > I've also managed to look at the code now. > > Reviewed-by: Laszlo Ersek > > Thanks > Laszlo > > > > >