public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH v2 1/1] RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue.
@ 2023-09-12  7:01 Nickle Wang via groups.io
  2023-09-12 19:07 ` Igor Kulchytskyy via groups.io
  0 siblings, 1 reply; 3+ messages in thread
From: Nickle Wang via groups.io @ 2023-09-12  7:01 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez

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>
---
 .../RedfishPlatformConfigDxe.c                        | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index f2a8e77d9b00..30d2ef351eca 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;
 
-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108516): https://edk2.groups.io/g/devel/message/108516
Mute This Topic: https://groups.io/mt/101310452/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/1] RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue.
  2023-09-12  7:01 [edk2-devel] [PATCH v2 1/1] RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue Nickle Wang via groups.io
@ 2023-09-12 19:07 ` Igor Kulchytskyy via groups.io
  2023-09-14  3:33   ` Chang, Abner via groups.io
  0 siblings, 1 reply; 3+ messages in thread
From: Igor Kulchytskyy via groups.io @ 2023-09-12 19:07 UTC (permalink / raw)
  To: Nickle Wang, devel@edk2.groups.io; +Cc: Abner Chang, Nick Ramirez

Reviewed-by: Igor Kulchytskyy <igork@ami.com>

Regards,
Igor

-----Original Message-----
From: Nickle Wang <nicklew@nvidia.com>
Sent: Tuesday, September 12, 2023 3:02 AM
To: devel@edk2.groups.io
Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
Subject: [EXTERNAL] [PATCH v2 1/1] RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue.


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**

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>
---
 .../RedfishPlatformConfigDxe.c                        | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index f2a8e77d9b00..30d2ef351eca 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;

--
2.17.1

-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108551): https://edk2.groups.io/g/devel/message/108551
Mute This Topic: https://groups.io/mt/101310452/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/1] RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue.
  2023-09-12 19:07 ` Igor Kulchytskyy via groups.io
@ 2023-09-14  3:33   ` Chang, Abner via groups.io
  0 siblings, 0 replies; 3+ messages in thread
From: Chang, Abner via groups.io @ 2023-09-14  3:33 UTC (permalink / raw)
  To: Igor Kulchytskyy, Nickle Wang, devel@edk2.groups.io; +Cc: Nick Ramirez

[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.chang@amd.com>

> -----Original Message-----
> From: Igor Kulchytskyy <igork@ami.com>
> Sent: Wednesday, September 13, 2023 3:07 AM
> To: Nickle Wang <nicklew@nvidia.com>; devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Nick Ramirez
> <nramirez@nvidia.com>
> Subject: RE: [EXTERNAL] [PATCH v2 1/1]
> RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue.
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Reviewed-by: Igor Kulchytskyy <igork@ami.com>
>
> Regards,
> Igor
>
> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Tuesday, September 12, 2023 3:02 AM
> To: devel@edk2.groups.io
> Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: [EXTERNAL] [PATCH v2 1/1] RedfishPkg/RedfishPlatformConfigDxe:
> fix can not set one-of option issue.
>
>
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
>
> 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>
> ---
>  .../RedfishPlatformConfigDxe.c                        | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> index f2a8e77d9b00..30d2ef351eca 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;
>
> --
> 2.17.1
>
> -The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI). This communication is intended
> to be read only by the individual or entity to whom it is addressed or by their
> designee. If the reader of this message is not the intended recipient, you are
> on notice that any distribution of this message, in any form, is strictly
> prohibited. Please promptly notify the sender by reply e-mail or by telephone
> at 770-246-8600, and then delete or destroy all copies of the transmission.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108632): https://edk2.groups.io/g/devel/message/108632
Mute This Topic: https://groups.io/mt/101310452/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-14  3:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-12  7:01 [edk2-devel] [PATCH v2 1/1] RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue Nickle Wang via groups.io
2023-09-12 19:07 ` Igor Kulchytskyy via groups.io
2023-09-14  3:33   ` Chang, Abner via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox