From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web08.4958.1607408428622794797 for ; Mon, 07 Dec 2020 22:20:30 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: aaron.li@intel.com) IronPort-SDR: fIutcTZpaepw7pMp87Zy17m8A8Jvq6z7VzvBSIReFnOXyTu0AmEYdDzzUJNob/Ca+TGjOYw4oZ widnqobqHU3Q== X-IronPort-AV: E=McAfee;i="6000,8403,9828"; a="153649128" X-IronPort-AV: E=Sophos;i="5.78,401,1599548400"; d="scan'208";a="153649128" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 22:20:20 -0800 IronPort-SDR: 9Qn/Yv5zCkQtqJVejVuqxfDLBWEh0VwVUj9CEpiBY4gs9laG5tNibYBDgfwytAr2PJN0LgG5Tj nIYKdm3aK2gQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,401,1599548400"; d="scan'208";a="332410861" Received: from sh1gapp1015.ccr.corp.intel.com ([10.239.189.85]) by orsmga003.jf.intel.com with ESMTP; 07 Dec 2020 22:20:18 -0800 From: "Aaron Li" To: devel@edk2.groups.io Cc: Ray Ni , Rangasai V Chaganty , Siyuan Fu Subject: [PATCH v1 1/1] IntelSiliconPkg/ShadowMicrocodePei: Fix return value in ShadowMicrocode. Date: Tue, 8 Dec 2020 14:19:24 +0800 Message-Id: <20201208061924.6082-1-aaron.li@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ShadowMicrocode should return EFI_NOT_FOUND when no valid Microcode found in FIT table. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3110 Signed-off-by: Aaron Li Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Siyuan Fu --- Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.c= | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMi= crocodePei.c b/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/Shadow= MicrocodePei.c index 5c7ee6910c8e..5539a121cbb6 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocode= Pei.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocode= Pei.c @@ -377,6 +377,9 @@ IsValidFitTable ( with microcode patches data in it.=0D =0D @retval EFI_SUCCESS The microcode has been shadowed to memo= ry.=0D + @retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL.=0D + @retval EFI_INVALID_PARAMETER CpuIdCount not equal to 0 and Microcode= CpuId is NULL.=0D + @retval EFI_NOT_FOUND No valid microcode found.=0D @retval EFI_OUT_OF_RESOURCES The operation fails due to lack of reso= urces.=0D =0D **/=0D @@ -460,6 +463,9 @@ ShadowMicrocode ( ));=0D =0D ShadowMicrocodePatchWorker (PatchInfoBuffer, PatchCount, TotalLoadSize= , BufferSize, Buffer);=0D + } else {=0D + FreePool (PatchInfoBuffer);=0D + return EFI_NOT_FOUND;=0D }=0D =0D FreePool (PatchInfoBuffer);=0D --=20 2.29.2.windows.2