From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 485DB94148F for ; Thu, 3 Aug 2023 06:00:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=j0GDtcvcwlQFR+4NBrqgFh58cscp/ILqA8lqHFZzFM4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1691042416; v=1; b=MLy+WE9t8jrku+0Hsc0oGAvxmLwfhdF533z7rKyCZhdEmNzjnAa3u0qxkjM9n3C+7un1iQ+J YQi7aICAO2E1+Of5Yr3ZuqpWjFwEBELIiJFoGI6rEToQB7PtNV3kuFgDZ8n7W1S1S8Qm8+b/mNV NnEy6yvzAz372D/D2OIi9V3c= X-Received: by 127.0.0.2 with SMTP id setfYY7687511xk4kfc41SWX; Wed, 02 Aug 2023 23:00:16 -0700 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.44]) by mx.groups.io with SMTP id smtpd.web10.8079.1691042415802044636 for ; Wed, 02 Aug 2023 23:00:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CnxbVqgi0S1ghwr5Pu7kwgPVxUw03cRiybFS2pQlpgi7RJTpIjyyphuiVLfEgaCF+4//J4uOUoPoGVdQUengbSutF2WxdntXyr9Jf0IvpW/txpCaLmh/nDjJU+GdDnxgKEDUTqz+5iWU5+IZ71nF6Ll7Bf//XcQxgB/rmAH5aE3z8FD29e7zd8UNny+/Sur6JgnwWQhGEk6dWlaYvB7E0My+lxt30Wpv91uYXTBmeMmtA+WqFmG17kWmbjeCJOvYcB1mJF7SvMzWxCFTYhf1aFeN+lvBNLJLz800Ae83eOrHtDtIMH59ad/TI4yE7Cmi2O3kCIA/gX04fdO2i6sImQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ApkWkRVkSEg/xtL69INXGWamOfzeMa0DJweZ1re+pd4=; b=m18NgdjDH7qFtfdJeBcmBqpanszgCoRKm1BHrTqGjABc54zhqKhHcdk9n8zXeTUxDLDqLF6WwPm8a80FQQHBfHJDsCg6S3H6gDhRzJm6z5qS6cGA/5SFEHUK16MF2zTjvxlPIN0eq8QH4u8ypkL0H9Ayq8GCP5osYTYMZEQ6+dHy4zwHRhw661yN63h1nvu7SBNLbk4QMvfMUvq4Dx6cKAzR3NiUaTubWaz8esx1R70rJllr80Z1NN1aeyumIDZMOBsZkyABbKaBt1Mfkg3AWo+iZsjbcRO7C3t0TKx6uE+YamNLcDopFik2S6hozrXg+Y4trwng0VanQVTo1buTpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Thu, 3 Aug 2023 06:00:12 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::1390:de0a:6b46:9837]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::1390:de0a:6b46:9837%7]) with mapi id 15.20.6631.046; Thu, 3 Aug 2023 06:00:12 +0000 From: "Nickle Wang via groups.io" To: Igor Kulchytskyy , "devel@edk2.groups.io" CC: Abner Chang , Nick Ramirez Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue. Thread-Topic: [EXTERNAL] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix can not set one-of option issue. Thread-Index: AQHZvHUapqG9/YfwuUqIspyvEWT8ga/IJ4oggA/96NA= Date: Thu, 3 Aug 2023 06:00:12 +0000 Message-ID: References: <20230722081816.212-1-nicklew@nvidia.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|MW3PR12MB4553:EE_ x-ms-office365-filtering-correlation-id: c17658cd-cec5-4697-5b40-08db93e6e6b6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: O3W3nT8WLmCsblTLcufMRDItkRQ3a6P/Ey0f2a/A9oPPLUsfsqX3nzu2WSgOmkGOGK2xKHpuPfuAv7Ara3FKRitPv8EGJlT4CjU7h1JY/tYkBPnGLXwqU3g7WgV5lLprSGjKuu4hV5tS5FjSy9y8Wk8UXabDNPXxzfim8m/96uNm1RZjbRCSFqyV+wqLrFlpcHR9V9MiviWg6tHUjBfwE4GVN57kKE5ok6F1cPC+u17cYSleVY8eU/ZAk+4jJBH2qAaZNFiXyYAPi4eWOPvrDGvK4kb7TQIE3Q2aufim9+VmajQvfe0tnbWEJnR/R7SYP+VYGN5xw0hCbD6Jgygv3dPlLDFBXuJLNOuC8Hveq2b6GJRTyNYf0VpF3yggcfLR9sC+lFjAHKldlKFM8EHgizC19p3Xh8F94Yvzok9y/IwvbCVhOvVVRa9EKTSkJly5l8X/ywoJLuoGpBNnnTDxQlklif1MiNrNjZLPr4Y1BD0Ci54XF294+o7FoLpPQcuZxecs2w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k6FvhCqmNBb/ghM46Rk3VfCUGpFpNwoFL4W?= =?us-ascii?Q?U0O+swoWspTxr3RL1gGUEXDmCDK/d64dOoRAj03nJUO3?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c17658cd-cec5-4697-5b40-08db93e6e6b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Aug 2023 06:00:12.5012 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vJbYakJCW4Pg7yZpHxLfjG0Q1P+liilU0f2odFCfiaTBvZ7w7Xli4gePF/3ZKD0s+qx4vgoJMMCRki5xvsN3pw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4553 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: mtubR22USPvIyrHCltvf7qU5x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=MLy+WE9t; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Igor, Thanks for your review. I think this is feasible. Let me try it and provide= version 2 patch. Thanks, Nickle > -----Original Message----- > From: Igor Kulchytskyy > Sent: Monday, July 24, 2023 9:49 AM > To: Nickle Wang ; devel@edk2.groups.io > Cc: Abner Chang ; Nick Ramirez > > Subject: RE: [EXTERNAL] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix = can > not set one-of option issue. >=20 > External email: Use caution opening links or attachments >=20 >=20 > Hi Nickle, > May I ask you a question. What is the point to allocate and copy buffer. = Then > delete the original buffer. > Could we just assign StatementValue->Buffer to TempBuffer and then assign > NULL to StatementValue->Buffer? >=20 > TempBuffer =3D StatementValue->Buffer; > StatementValue->Buffer =3D NULL; >=20 > Result would be the same, but we do not need to allocate and free memory. > Or I do not understand something? > Thank you, > Igor >=20 > -----Original Message----- > From: Nickle Wang > Sent: Saturday, July 22, 2023 4:18 AM > To: devel@edk2.groups.io > Cc: Abner Chang ; Igor Kulchytskyy ; > Nick Ramirez > Subject: [EXTERNAL] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix can = not > set one-of option issue. >=20 >=20 > **CAUTION: The e-mail below is from an external source. Please exercise > caution before opening attachments, clicking links, or following guidance= .** >=20 > StatementValue->Buffer is converted from ASCII to Unicode by caller > already so we don't have to convert it again. >=20 > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe= .c > b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > index f2a8e77d9b00..648f3d2de7aa 100644 > --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > @@ -1660,7 +1660,11 @@ RedfishPlatformConfigSetStatementCommon ( > // in string format from HII point of view. Do a patch here. > // > if ((TargetStatement->HiiStatement->Operand =3D=3D EFI_IFR_ONE_OF_OP= ) && > (StatementValue->Type =3D=3D EFI_IFR_TYPE_STRING)) { > - TempBuffer =3D StrToUnicodeStr ((CHAR8 *)StatementValue->Buffer); > + // > + // Make a copy of input buffer to TempBuffer because StatementValu= e will be > + // assigned in HiiStringToOneOfOptionValue(). > + // > + TempBuffer =3D AllocateCopyPool (StrSize ((EFI_STRING)StatementVal= ue- > >Buffer), StatementValue->Buffer); > if (TempBuffer =3D=3D NULL) { > return EFI_OUT_OF_RESOURCES; > } > -- > 2.17.1 >=20 > -The information contained in this message may be confidential and propri= etary > to American Megatrends (AMI). This communication is intended to be read o= nly 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 th= en > delete or destroy all copies of the transmission. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107516): https://edk2.groups.io/g/devel/message/107516 Mute This Topic: https://groups.io/mt/100292370/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-