From 4a1afea6f7361fd65e9d4ba34eaac48ec8bb2867 Mon Sep 17 00:00:00 2001 From: Nickle Wang Date: Fri, 21 Jul 2023 21:39:10 +0800 Subject: 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 Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez Reviewed-by: Igor Kulchytskyy --- .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'RedfishPkg/RedfishPlatformConfigDxe') diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c index f2a8e77..30d2ef3 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; -- cgit v1.1