\r
Copyright (C) 2017, Red Hat, Inc.\r
\r
- This program and the accompanying materials are licensed and made available\r
- under the terms and conditions of the BSD License which accompanies this\r
- distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
- WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
**/\r
\r
#include <Library/MemoryAllocationLib.h>\r
because the ownership of S3Context has been transfered.\r
\r
@retval EFI_SUCCESS The translation of S3Context to ACPI S3 Boot Script\r
- opcodes has been successfully executed or queued.\r
+ opcodes has been successfully executed or queued. (This\r
+ includes the case when S3Context was empty on input and\r
+ no ACPI S3 Boot Script opcodes have been necessary to\r
+ produce.)\r
\r
@return Error codes from underlying functions.\r
**/\r
{\r
RETURN_STATUS Status;\r
\r
+ if (S3Context->Used == 0) {\r
+ ReleaseS3Context (S3Context);\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
Status = QemuFwCfgS3CallWhenBootScriptReady (AppendFwCfgBootScript,\r
S3Context, sizeof (SCRATCH_BUFFER));\r
return (EFI_STATUS)Status;\r