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 BBD767803D7 for ; Fri, 27 Oct 2023 02:35:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=DytvQD2P35q92/sQKfIui8Y+Okn6WFs4CoaaYC5Rvao=; 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:msip_labels: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=1698374110; v=1; b=gI0OLojXdiLE/IgK6vGfODs40qExba/dOQfxqKUApJIeEmGhEg1JkJ6JpB+T7khSj1heGEwK aJ0QTnKr0sgBfmk3H2/WTg9r6F8q+Ui49eR3PsnYwM90IpqyBDKZQ+X1wszVABCvq1t20Se0ki2 xQAuxkLF1KPMiNLaFWg5O9jU= X-Received: by 127.0.0.2 with SMTP id MLHcYY7687511xmrtFmbWimu; Thu, 26 Oct 2023 19:35:10 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.69]) by mx.groups.io with SMTP id smtpd.web11.88506.1698374109471757350 for ; Thu, 26 Oct 2023 19:35:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hMGYavITsM3GL0PE8zvDIMO9q1BDfYN9QHzgp32sKGiT1bCsdxgn+R43Ji79lr5WBg2usmtPr5VHKhFJvnVMghnskbct3vU1Y9lj5JbZ79mnXsw2MkhFqJNlqEYgJWjJRQJPBX85kdgeBD9fA8VbKQrZnMnnC7tQ4tVMX+zWPd0+S9TZm7U0HfzhBbMsNH5pQM6aKeNfaVsPeMlYWHLFdsUzrtlkAHNjqkFWEOmRqxqJGlGwugrjv9EwJ/2vWOQ2oqoiI4LRlN+sg1b/BkBHc5xj70BUMd1Bp75G2W0pNpUrqSieh1hyvJS0R+tTH8OetaIbw2VYYQDLe7RFfX6+ow== 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=eyEzrKS912FyLI/udzIt/+0T6MztUJKd+PxV567GjV8=; b=ASJObtSDnpnFNKS+0Gps+w5LN1vbsJhjDk6/u0iUygzUdHLYFaSFUnbChMlQYaY7WXGdelpzcS93RrCubMUbNpjdrKQB31DYa2ZG3kFWXfdO7ity5CHXYhckjWUPzZJwXAvW1HkTU6PzMBtIAhAjqrqb/DfYGjjnJn51hg56gB1uSGipqgv9x25EzlyknGdBz117zQs9IeQK2rwcW1mJOAYfmn4YaJPbthA9kROlPXADwBScDmXPTL5ldEzqakPDHW/rcnX8p+OviRsH2hyza7J+x4bomh2kJQ+KUUs3nrL9uNLDF/Lcz6zoieGo13O7Of3305xAvavlOSiLE4LzqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by SA1PR12MB6678.namprd12.prod.outlook.com (2603:10b6:806:251::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Fri, 27 Oct 2023 02:35:07 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::e670:e45f:fa32:2420]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::e670:e45f:fa32:2420%6]) with mapi id 15.20.6933.019; Fri, 27 Oct 2023 02:35:07 +0000 From: "Chang, Abner via groups.io" To: Mike Maslenkin , "devel@edk2.groups.io" CC: "nicklew@nvidia.com" , "igork@ami.com" Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 11/11] RedfishFeatureCoreDxe: add check for memory allocation failure Thread-Topic: [edk2-redfish-client][PATCH v2 11/11] RedfishFeatureCoreDxe: add check for memory allocation failure Thread-Index: AQHaCGe3cEgtYez4j0q1ygn9L7sdrrBc65HA Date: Fri, 27 Oct 2023 02:35:07 +0000 Message-ID: References: <20231026235354.67625-1-mike.maslenkin@gmail.com> <20231026235354.67625-12-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-12-mike.maslenkin@gmail.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=0e0c85f6-0f4a-4e69-b053-dd09c988441a;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-10-27T02:35:03Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|SA1PR12MB6678:EE_ x-ms-office365-filtering-correlation-id: 4a2360dc-9f35-46ba-43c6-08dbd6955534 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: K9V88xCDkBZ5bQnyZUVf6T3/KXg1b2mi9KN07zCMEhAEb/K+BwaxMRfgKDps3t8eut/Xw/l7liG2ONlpF8LtqJeDjamaVeWgoxCtuKSDVC4c1429aNP1s1gi/HNqcDJ18PxjW2giGXR4M4v2MKNbe0AuF8F3R3zcUogbdW9h1MnuTEpVkvHHKZGhgk9vGoYWVkhI29lQaqX2PR/KlBHsET1tDbDqhLk97O2B+06PRLcddrrAp6c0JI1A7WvJQjVEVlXd8XKJwjy//11Cbf9V9Aj73fL9LgHdT56KsUq7xeicWvJfP80gdeXK7rDe0jgGNya6/Rb+PWgXl76WA9qKkUBXZDsf+9LvRxUB74YIif2YJROWqss4PbX5pqy6CMbRROpLdDHqPMDRCA6u1uwKU2foKels/em7jfLYlnODN/wmUXP9YYvAUy9IQ3+yDLBZYzuITTjRX5FQPN/cPcijlqnh3odJWKAjFdCGKxpm4ccXogirzs//5GW843GaCDukzzmm9HBDmE/Lr5g+Ulm8LaUQsSO4WGO90zQjAq4bg6XX7QvftVp/NCYd7ev8KFFGl77g+2aXEDJQfMmsiTqA2uGxecGNuIQoRgKIonBchP6En2CLa/10kRsXdKV29XjoXBtwAuI58LPkACP7Rn133K1ry51XAgefxuBCy+joBl0YsUAQLOt8UiHJXwawcrPb x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?EDtUtrUiyO9SH7N0C5Q4Nk5WCpwi+YrZ0Sw54LaVpETEqjJw0/NG40I/B4Ha?= =?us-ascii?Q?CZkyIRzfF1o954lilB3rF23E/oxr8yaLCkHyUaG11fw7P5GVQoN4oHO8NDXQ?= =?us-ascii?Q?yL82wI9btfHBMgWk2uJl9PGSdT3sPQiXtaVTOidjQ7dvb6PxJ6O7XrVIUR/R?= =?us-ascii?Q?wILJLMlRx3zJYKx0l4GtHVfCp6cxFkSmmX8rMs4FdLP/BY8jnt8zgNPBQfaO?= =?us-ascii?Q?O1enELWCU18QZ5mixmtWPrtou66BSzxwcjAhoADL5kdpgVb6FIkvw6++Am+z?= =?us-ascii?Q?dNpEwZ/EmrgmT1QwZVdLB87o8FEobB/4wqLZw41q4xSkhe2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uamqbDsBwlugxKRh+tjPz0WhpNBTwbVr5UdLEz/Te?= =?us-ascii?Q?MRSVBPt9PVCMJLA2euVl4HhCd7Nw8/5bV2AHOpMfcLFi6zEkIUydDxI8IkUi?= =?us-ascii?Q?FQOx0FDd64gTsNvWTzkyx/Dl+s0cdxmCgpgUrJid8XuYN0kI3qL+a5I4i8cL?= =?us-ascii?Q?EkMOMidVvwdNG0V2NYGmCeAnQM6rbi5/+gfsYUb/z6mBpQr31XTF5GVR9ix9?= =?us-ascii?Q?b4QDQs7mNlzgRIxGxhBZDNQ8h+PxoVl4bnPTbec0GXK4o1syRbgvYLmlJVEX?= =?us-ascii?Q?v64lMq/+R6TWYUX6pqWJJEvCykYgVy68npFXXffstQJsCnYT7gX++MGbnmOF?= =?us-ascii?Q?eSCJqYdVdnPsGa6aqDVCwa2dQazoa0l4+44PTL+I?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a2360dc-9f35-46ba-43c6-08dbd6955534 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2023 02:35:07.0464 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0d4UoOVJerCnBdArK9a+RQzetRAS7RPh2e5A3oOTDwrWq/Ez9ZfWPL8o/E64imp5toiD5MEhogbIXUbH2HAYTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6678 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: YAFHS5kaWjdHCvWVNOP1dWOzx7686176AA= 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=gI0OLojX; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Mike Maslenkin > Sent: Friday, October 27, 2023 7:54 AM > To: devel@edk2.groups.io > Cc: Chang, Abner ; nicklew@nvidia.com; > igork@ami.com; Mike Maslenkin > Subject: [edk2-redfish-client][PATCH v2 11/11] RedfishFeatureCoreDxe: add > check for memory allocation failure > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Signed-off-by: Mike Maslenkin > --- > .../RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe= .c > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > index f71b12e4b5e0..d9aa6e1a8145 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > @@ -331,6 +331,12 @@ NewInternalInstance ( > } > > > > NewInternalData->NodeName =3D AllocateZeroPool (StrSize (NodeName)); > > + if (NewInternalData->NodeName =3D=3D NULL) { > > + DEBUG ((DEBUG_ERROR, "%a: No memory for NodeName\n", __func__)); > > + FreePool (NewInternalData); > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > StrnCpyS (NewInternalData->NodeName, StrLen (NodeName) + 1, (CONST > CHAR16 *)NodeName, StrLen (NodeName)); > > NewInternalData->SiblingList =3D NULL; > > NewInternalData->ChildList =3D NULL; > > -- > 2.32.0 (Apple Git-132) -=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 (#110169): https://edk2.groups.io/g/devel/message/110169 Mute This Topic: https://groups.io/mt/102211780/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-