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 2E11F740037 for ; Mon, 24 Jul 2023 01:48:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=hInVxRWJ8jZO9HIfyfAHhtECr4S6YAMeC2j1fHsSD0E=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:X-Received:X-Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:x-ms-publictraffictype:x-ms-traffictypediagnostic:x-ms-office365-filtering-correlation-id:x-ms-exchange-senderadcheck:x-ms-exchange-antispam-relay:x-microsoft-antispam-message-info:x-ms-exchange-antispam-messagedata-chunkcount:x-ms-exchange-antispam-messagedata-0:MIME-Version:X-OriginatorOrg:X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-Network-Message-Id:X-MS-Exchange-CrossTenant-originalarrivaltime:X-MS-Exchange-CrossTenant-fromentityheader:X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype:X-MS-Exchange-CrossTenant-userprincipalname:X-MS-Exchange-Transport-CrossTenantHeadersStamped:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubsc ribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1690163321; v=1; b=SyhBsuVAjFQG5ym8Ix3xVkvO4BsGBquROdYaSPcxHsOaecaEM7HBI4BLPE0Pg2/BEMdLQhbX nAcqYSQYfv/dMiZP+EDF33+O1PQHPBJqP8k8bFC2Xn+olZPw1QrY32nUpmB9DdQ5y22DpwNu6fZ 8VCh8tZYfaFNvzK+O0yyklP8= X-Received: by 127.0.0.2 with SMTP id BABXYY7687511x8WuFgQq1Rq; Sun, 23 Jul 2023 18:48:41 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.85]) by mx.groups.io with SMTP id smtpd.web11.39130.1690163320668562394 for ; Sun, 23 Jul 2023 18:48:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TUQUGEW4aSh0XHUfkMyjKQnyIcRrJ+44pzWrDijeyHMl4fHZ7FSZTH+sDZ1MP2tyCQskvqem7Lsr6eGUClOMmGLU5z8yFzsCXP2w55bor9XjQ5uA1NQVL5ISlH5BWDYdrfezmQ4xald7dfhpOVbhe1iO56Q3Ph5cJXaei/iZ9t3tMlSRBmWvF9PDlKjb9AkME0Kkzy6hIk4D1bSzr3t/JtjW/YjjkAzKHzNeMPgViCXf2MXhmupYNXCxh5XZP0EewBn1pzKbOF3afcB2kdcEUTv9wbAIce5YInCN+BgrYdHO2tIYpzXQ/xVtw2oWP+b7VkFb/ozR75bGiWWpANMIyg== 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=P/iYsKnmrPKepGfXq8VtX2MWNB1eQMk+CkzesiVpabI=; b=Le5jwyrlY+xHT2yF13SXZU5li5bYPpCotgOLZ7ekEzL154JovEKZYCUKaNIkMI2233UHY95vagcx06lMwilHcWT71v4wiZdMLTZL5KKH0L0MgAqmF4G5a8AgJcm7jFHn4oiJC8r3nyXf44Iuz4qwv/EiI8oFG68tsyhoeLK+DsIO1jBvzGtA3qmMMrlNkBE4pebZEWHnh3a3veCXM+6iF5vRRaRQ7l2BBz32K22D+eh/zfK964XXRiPLGvsv8NIsCoCv7+sLn5OY/IJf1gZICae0WgPaz1wK/d4ScCMGYcWSim8VFmRk3sz/L8Vti0NinZ0PLR/p/4vmyDjspAS8Qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none X-Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by BL3PR10MB6209.namprd10.prod.outlook.com (2603:10b6:208:3bd::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.30; Mon, 24 Jul 2023 01:48:36 +0000 X-Received: from BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::54b4:fe44:b9d9:ab6d]) by BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::54b4:fe44:b9d9:ab6d%4]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023 01:48:36 +0000 From: "Igor Kulchytskyy via groups.io" To: Nickle Wang , "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/IJ4og Date: Mon, 24 Jul 2023 01:48:36 +0000 Message-ID: References: <20230722081816.212-1-nicklew@nvidia.com> In-Reply-To: <20230722081816.212-1-nicklew@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BLAPR10MB5185:EE_|BL3PR10MB6209:EE_ x-ms-office365-filtering-correlation-id: 1a7d354e-40e2-4af8-aa9d-08db8be81863 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: t1nSxgp0zi/W0nTBfsNU7BPMjUXXFGSYjY1L39Xj5J0EQ2Ofh21iB7T/3goLxdV+S8Qqq8vStuvwh9TkZkif0opVIhI7/d5CR1tKzEVVTOtYzNajyXA1b0ANFqIWw3CTc1Q5f7HEnxdxLe/J/TDxCLOBkVgrFxsxTs1ytia7w+J061fV1Npuz7aIMbD2qaGXkYXCKzmOynAYd6a/GZRcugsHh6g3idYSz9KMC/V5KDfInxBNU/XATTbcjW0KKLupvO/pgQuYyS+iaJMZ8C0ZAcdgI6qHyrGmdgh0VJg8QpG0vsshxbtMzp/3Y6IXW09DBvVEaFvPacSxytLA1FvYs9FQCAna7eZjGSrt25qL0+t8/3Li18s2DeJ47moVRT/0mu6BHma2dx3GdrygeLoJKk9z339bRZ5k6qBYw0torMSlOC4twgmtIoTW4OlHWjuSv6ZJzlZfbCt5pLEuKE4i1F2cZ1fabCJSzksNTXNbPywCtb+9CTl/ztwCTHfGW+u4nD4tUd43KfDkhrPYs7ZyWbwU6zQ6Z/p5OmevHNJWbHbqPtWm9ODi740qMtGuN/nx+kZNvKf9oHf52Fc5lSBurX9zn45P2GJzzZFjhcI7egHDIQqDhs+7tUV/WBMjSJQ0 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DotLc0boVy3YGSqKK2gOcru7c+BLIwzlHB/GaJiyQqTfd25+IvsMFztWOfjj?= =?us-ascii?Q?9ZnmpJQSykJPF/9oPVtn9urG641Wtpdgu1WEyeoNZnqMsHPjOlJdTcH0SDBi?= =?us-ascii?Q?HF5Tb9nOPN1wd29JIndXmmjAWDm09eF/yBYwzEaKbad2W/Hiw12xKmRIogx2?= =?us-ascii?Q?OvbHjqwAShdLsqj4HxwXtSwVvZO0tmLmBaxKvPHzYXlnPvaBM1KgH7iYB59P?= =?us-ascii?Q?QhORtEIRG/9M0bo8m/jyi0kJwy7DySGvjxSBBAx8Hws/S239fyxBZNuhOT4C?= =?us-ascii?Q?bvWbBRBGUKJeYjO3cV63dx3dFI5qyULgqFFqOK9lt3okMsNt/Mc7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GzM/WW0V9Cm5UhfLlwffvHtopfd0smD+NOw?= =?us-ascii?Q?MtVvEen3EpBLRbqvgPGIt3o+4hsNETGXIbMOivmta36K8H/HgQhXkFePXQiS?= =?us-ascii?Q?SGhjb5pT8zZbf3cKM4jMhduNR6906EoBLlZWnhHDhy/4tsfhX1z1+CJ15zn9?= =?us-ascii?Q?VnBplPbMzhxiBveubp9STVd+xv0udOPC/kx+l4t45LXwn5s4d7hUdw0IkHT7?= =?us-ascii?Q?b98+zUuIVNZoxx2t/D7m5RmMVdyqcotzcLFiqe1XEMq8cZpAfFPnkqzCKXTx?= =?us-ascii?Q?OdeRbvamSwVzQSWXiyWsr+4kwWxmN7GR1QTCptSNCG5RJ7eHWg76cPbGkLxm?= =?us-ascii?Q?nJO1TkLowjpaACW6IhM=3D?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5185.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a7d354e-40e2-4af8-aa9d-08db8be81863 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2023 01:48:36.0672 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: c9eWuuTMh00jzLasFAXA2G1mfRXSF42MoYxNMgPM9cjEt4MP1eStLLV13l6g+tJ4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR10MB6209 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,igork@ami.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4apenHI57UG89RqbMPRQDYcux7686176AA= 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=SyhBsuVA; 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; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Hi Nickle, May I ask you a question. What is the point to allocate and copy buffer. Th= en delete the original buffer. Could we just assign StatementValue->Buffer to TempBuffer and then assign N= ULL to StatementValue->Buffer? TempBuffer =3D StatementValue->Buffer; StatementValue->Buffer =3D NULL; Result would be the same, but we do not need to allocate and free memory. Or I do not understand something? Thank you, Igor -----Original Message----- From: Nickle Wang Sent: Saturday, July 22, 2023 4:18 AM To: devel@edk2.groups.io Cc: Abner Chang ; Igor Kulchytskyy ; Ni= ck Ramirez Subject: [EXTERNAL] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix can no= t set one-of option issue. **CAUTION: The e-mail below is from an external source. Please exercise cau= tion 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 Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 StatementValue = will be + // assigned in HiiStringToOneOfOptionValue(). + // + TempBuffer =3D AllocateCopyPool (StrSize ((EFI_STRING)StatementValue= ->Buffer), StatementValue->Buffer); if (TempBuffer =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } -- 2.17.1 -The information contained in this message may be confidential and propriet= ary 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 desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. 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= . -=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 (#107150): https://edk2.groups.io/g/devel/message/107150 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-