summaryrefslogtreecommitdiffstats
path: root/RedfishPkg/RedfishPlatformConfigDxe
diff options
context:
space:
mode:
authorNickle Wang <nicklew@nvidia.com>2023-07-21 21:39:10 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-09-13 03:23:24 +0000
commit4a1afea6f7361fd65e9d4ba34eaac48ec8bb2867 (patch)
tree1b67e28cb31931e7acdbfed266468f9b548698ab /RedfishPkg/RedfishPlatformConfigDxe
parentb844b106e2a20c709ece1b2b89b2ae0e84a0e401 (diff)
downloadedk2-4a1afea6f7361fd65e9d4ba34eaac48ec8bb2867.tar.gz
edk2-4a1afea6f7361fd65e9d4ba34eaac48ec8bb2867.tar.bz2
edk2-4a1afea6f7361fd65e9d4ba34eaac48ec8bb2867.zip
RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue.
StatementValue->Buffer is converted from ASCII to Unicode by caller already so we don't have to convert it again. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com>
Diffstat (limited to 'RedfishPkg/RedfishPlatformConfigDxe')
-rw-r--r--RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index f2a8e77d9b..30d2ef351e 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -1660,12 +1660,11 @@ RedfishPlatformConfigSetStatementCommon (
// in string format from HII point of view. Do a patch here.
//
if ((TargetStatement->HiiStatement->Operand == EFI_IFR_ONE_OF_OP) && (StatementValue->Type == EFI_IFR_TYPE_STRING)) {
- TempBuffer = StrToUnicodeStr ((CHAR8 *)StatementValue->Buffer);
- if (TempBuffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- FreePool (StatementValue->Buffer);
+ //
+ // Keep input buffer to TempBuffer because StatementValue will be
+ // assigned in HiiStringToOneOfOptionValue().
+ //
+ TempBuffer = (EFI_STRING)StatementValue->Buffer;
StatementValue->Buffer = NULL;
StatementValue->BufferLen = 0;