From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.72183.1673272804664614480 for ; Mon, 09 Jan 2023 06:00:06 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=IY3RHOiq; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673272806; x=1704808806; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vGjUiL+i8k/yG8b2ncJ5T49UxTFnRaftSAzodi0FYFA=; b=IY3RHOiqH8+C2aMJMgu3Rdv3JOEY3FnDG3zw564J49/hX5aXTPUGPx56 byiQ0e4oLelXnCFIzpfA15JpmYSOFgCZ0zwB8KPnpKFmmo39tIWwpxn6y KTIkhxpWaQIBwKm76SsosZqpPiAuMNx6d/Im/mzrsvS02cKzevZVFEcbx 10PuSlCIKChOaw3wbDPOmS+uU6XxN2QV8aC9rUdWwBT9KLT30qznJkVPD 1YZ1u1Fc06b1o2dAbQDV9UVWtr5YW8ujUIyfmtgIizCNB4ChVOuGWJ8xR mpn8DDqgj0I9r0i68MI+tvUS15GS/llzlLzjck7za5WYY2+p8T7LucJGO A==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="306394445" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="306394445" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 05:59:47 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="634217706" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="634217706" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.30.4]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 05:59:44 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky , Sebastien Boeuf Subject: [PATCH V2 6/6] OvmfPkg/AcpiPlatformDxe: Return error if installing NotifyProtocol failed Date: Mon, 9 Jan 2023 21:59:17 +0800 Message-Id: <20230109135917.1752-7-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: <20230109135917.1752-1-min.m.xu@intel.com> References: <20230109135917.1752-1-min.m.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4237 Installation of gQemuAcpiTableNotifyProtocol may fail. The error code should be returned so that the caller can handle it. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Cc: Sebastien Boeuf Signed-off-by: Min Xu --- OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c index d849a59526b5..98e4f02203d8 100644 --- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c @@ -89,12 +89,16 @@ InstallCloudHvTablesTdx ( // Install a protocol to notify that the ACPI table provided by CH is // ready. // - gBS->InstallProtocolInterface ( - &ChAcpiHandle, - &gQemuAcpiTableNotifyProtocolGuid, - EFI_NATIVE_INTERFACE, - NULL - ); + Status = gBS->InstallProtocolInterface ( + &ChAcpiHandle, + &gQemuAcpiTableNotifyProtocolGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } return EFI_SUCCESS; } -- 2.29.2.windows.2