From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.7643.1598943766181002779 for ; Tue, 01 Sep 2020 00:02:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H2wIFKVu; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598943765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wzWOIrXCT3evaTODZp4REt6P1X9g4GFwq6gleRgLcys=; b=H2wIFKVuSUtIgugYdXrLdoOBxwYmxWEWuQTqWp4ZuYYAQIBQBShWnt3gsXl91HI3gmqjL1 JEdEOLWfnDcGYIuQPAx9Jk6MX8AYZ+IIWx3ANM9bl32x4FBf2R3uRFBjqQGvwKvrVHqST1 vysyKiW2qCZMhm+KOAwkn7Wg1/UgZJQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-f71t0fESNgehf-X7536mtQ-1; Tue, 01 Sep 2020 03:02:35 -0400 X-MC-Unique: f71t0fESNgehf-X7536mtQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 737538030A4; Tue, 1 Sep 2020 07:02:34 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-251.ams2.redhat.com [10.36.112.251]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1090B2639D; Tue, 1 Sep 2020 07:02:32 +0000 (UTC) Subject: Re: [PATCH] SecurityPkg: Initailize variable Status before it is consumed. To: Zhiguang Liu , devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Qi Zhang , Rahul Kumar References: <20200901005505.1722-1-zhiguang.liu@intel.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 1 Sep 2020 09:02:32 +0200 MIME-Version: 1.0 In-Reply-To: <20200901005505.1722-1-zhiguang.liu@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US On 09/01/20 02:55, Zhiguang Liu wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2945 > > V2: Move "Status = EFI_SUCCESS;" before the EDKII_TCG_PRE_HASH check. > > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Qi Zhang > Cc: Rahul Kumar > Cc: Laszlo Ersek > Reviewed-by: Jiewen Yao > Signed-off-by: Zhiguang Liu > --- > SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c > index 0e770f4485..93a8803ff6 100644 > --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c > +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c > @@ -456,6 +456,7 @@ HashLogExtendEvent ( > if ((Flags & EDKII_TCG_PRE_HASH) != 0 || (Flags & EDKII_TCG_PRE_HASH_LOG_ONLY) != 0) { > ZeroMem (&DigestList, sizeof(DigestList)); > CopyMem (&DigestList, HashData, sizeof(DigestList)); > + Status = EFI_SUCCESS; > if ((Flags & EDKII_TCG_PRE_HASH) !=0 ) { > Status = Tpm2PcrExtend ( > NewEventHdr->PCRIndex, > Reviewed-by: Laszlo Ersek I'll let Jiewen or Jian merge this. Please change the status of TianoCore#2945 to IN_PROGRESS, and link both versions of this patch into the ticket as well (in a new comment). Thanks Laszlo