From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.77]) by mx.groups.io with SMTP id smtpd.web11.9900.1633702022610140483 for ; Fri, 08 Oct 2021 07:07:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=SWbtUiET; spf=pass (domain: arm.com, ip: 40.107.21.77, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mxs2xsGzkmW6hjzhlOAMNWYTDkDr9t1h1RNtGjny21U=; b=SWbtUiETKEjUjjXW33xDfYV+ocaVkr6gq+ZnFW7HSykyBtvQIDx+0z2pD5mag87VIqaqv4GX2h9PHtZ2J3yWVkxok4A9+ZTtlTIjuT3RkCBFotyUFrdchGQTUmPRYGv0rxm6nbA+4ClQKty5e/lgSKpFoYUFfj7q9rEUq2VFjNM= Received: from DB6PR0601CA0042.eurprd06.prod.outlook.com (2603:10a6:4:17::28) by DB6PR0802MB2471.eurprd08.prod.outlook.com (2603:10a6:4:9f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Fri, 8 Oct 2021 14:06:57 +0000 Received: from DB5EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:17:cafe::fd) by DB6PR0601CA0042.outlook.office365.com (2603:10a6:4:17::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.21 via Frontend Transport; Fri, 8 Oct 2021 14:06:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT053.mail.protection.outlook.com (10.152.21.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 14:06:57 +0000 Received: ("Tessian outbound f1898412aff1:v103"); Fri, 08 Oct 2021 14:06:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a490eab051f3a971 X-CR-MTA-TID: 64aa7808 Received: from 13661e7ce9e5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 101B68A7-4591-4D41-A7BD-651E4EB07E6E.1; Fri, 08 Oct 2021 14:06:46 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 13661e7ce9e5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 08 Oct 2021 14:06:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yx++313zXUwIAvYsoSqgo9ojPlv64nUl9jnx4m2lYEVuQNyyDXOBAigwNOgPAPHhX96hFbMuOODVnJwgOnymaLtSdVXWzu0PjY+aDBA17PR3vJsgzCOSQ/i322f2zAO4+Sy0S9J3TJjK6i18BXFgMC7zR7K42krx8oGpc4oJuk51izbXRjxiUoHspFZz4sLRHDq206iOTEOkEcqT04G7zFMgqrGsfvCg1xdLD8e4reHGBZRFt8Lo0Cp5ZST5/dlDjPv5/eppnoUEixGAQT0GaUvV/i6GoOjf0CHBjcVSWS3u5Ebmscpo74SqiAKTvH46vh/FTs/3HOimQVHSBLKTPA== 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=Mxs2xsGzkmW6hjzhlOAMNWYTDkDr9t1h1RNtGjny21U=; b=K7JHr1QSikvQbD2oQdvvm6HoksQ4on+ZtiHGJq2GptO6cDxMis3pSzz6POrPNaUdr4J9ihULUEfbweHE4b5t4XhS+IJ2YgmqC3uckNvxfSuYXa05Khdcjc3lPx1B5W69ib/4hOcmAAvSaKAa8rV4JKwn0G7qTR3ryH+4Zt1Itml0DcOeEJ1lXL4c/k6tJlLGcFZ7cuul6GLRYttMWUgFam0pLogN0GGmUlyxqIQSUJpU/Us90Zq9mPyClkXrMZTZjmcaWNsU2u1Ty8vYZ4LXiwc8oJ+19dvBK3xJcEYUi7mDyQPqeoMAI6Dht8RsKUp3sPZiRJadODoMsZ4e0kLr5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mxs2xsGzkmW6hjzhlOAMNWYTDkDr9t1h1RNtGjny21U=; b=SWbtUiETKEjUjjXW33xDfYV+ocaVkr6gq+ZnFW7HSykyBtvQIDx+0z2pD5mag87VIqaqv4GX2h9PHtZ2J3yWVkxok4A9+ZTtlTIjuT3RkCBFotyUFrdchGQTUmPRYGv0rxm6nbA+4ClQKty5e/lgSKpFoYUFfj7q9rEUq2VFjNM= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM6PR08MB3383.eurprd08.prod.outlook.com (2603:10a6:20b:50::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Fri, 8 Oct 2021 14:06:44 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::54b5:239d:9896:ee65]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::54b5:239d:9896:ee65%4]) with mapi id 15.20.4587.022; Fri, 8 Oct 2021 14:06:44 +0000 Subject: Re: [PATCH v2 08/21] DynamicTablesPkg: Update error handling for node creation To: Pierre.Gondois@arm.com, devel@edk2.groups.io, Alexei.Fedorov@arm.com, nd References: <20211007153210.26608-1-Pierre.Gondois@arm.com> <20211007153210.26608-9-Pierre.Gondois@arm.com> From: "Sami Mujawar" Message-ID: Date: Fri, 8 Oct 2021 15:06:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20211007153210.26608-9-Pierre.Gondois@arm.com> X-ClientProxiedBy: LO2P265CA0414.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::18) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 Received: from [10.1.196.43] (217.140.106.52) by LO2P265CA0414.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 14:06:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2efa362-f987-436e-1f43-08d98a64e3fb X-MS-TrafficTypeDiagnostic: AM6PR08MB3383:|DB6PR0802MB2471: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6430;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: jrGAZpDrkJQs/xD0OadgDBkwuLICxR5iX628ZDPbOsNYwcseOHuQ8wVCkkwjvc0rTFCsRSgTKCTh8jsJhnIFmXrU9D5S+8sVZ4vesAEpJviiL0+WGDv8RS0wgQqUGBWqHi6whWl2hh6QadS6EKmbh7A4vKnPh+NlKxBNtcaEEI36e4ZDtsunocelO2jfCTAyFCAhA8yaijePIpaDBVid7jNeeJxOm3uJzKvwrR9laPVJN+P4Z/i4AWsc7Xl2j1IIJihx6+fohGJSCEJ8I+MaRBJmStO7NoNR2u2509cTZ/AOL1TekCSl3x/Uw4VVx1eAtaY9LWqbQTdzExShKSpKRyMjhwLUzd9nY5zPTTevUx2ua5MATRD5EMFQxflph/1vGLZDfNOgQddikSm0M/OG6tQTdYrrPhEibM1UPPAIjbminWEp4GOh1kjp8/JcrdRoKpY4b8wJ3XY1VrNMxDfrmkDR6Dnh79HX7WKnG2k544HQbfuJBUs4NndNg5dd28rNyQXIEFgne/ay/nHVJIB5W1mo+1jxaEgoeoTnVCE6/iMxWVrtPkfGgiFxhnlUMI3oAr67f2NauWbg8gzFAwOy+vChUG6ZjhZRyeSto7z83bRr19P88ACkj/CDcVL3ImVcVL7b38hTEPgpSZKtLj2uf8e2Gl9KAoNn/gy9a1WZPS+8WsLTPTSjrRCFdVC1dhrCEdJ5WDhH9OpMP7xl0MvsX3T4MdOv47SN7SCEMrMS5IDHBxTNOgJfsgmR/FMCk+dIyaBKW0rc0eOex0ScWppJEg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(8936002)(86362001)(38100700002)(15650500001)(26005)(6862004)(38350700002)(6636002)(44832011)(508600001)(36756003)(53546011)(37006003)(316002)(16576012)(2616005)(66556008)(6486002)(5660300002)(186003)(66476007)(956004)(66946007)(52116002)(2906002)(8676002)(83380400001)(31686004)(31696002)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3383 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 83e49063-304b-4f69-b5d3-08d98a64dc3e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gNFFRozkEhjj9sJoPk1SOdKbYrvG2VHOP9+2JfHNhYdMaFMv2EiMNoAUzsAQnSMVVFEi7J7Movs86vcac3mL0H/f0U5pO/JWa4jLEQiNtoJfCPutRvZkaNr3RY1ovZ0NXYY/ozp8lcdlTx9UOVq6JfJgNa2mXCmCA5Mko5PIVfG/t6cewVlmg7iD4vjZaLA5F489khjZddtzFbeVlF5/sXmMSmCY9+JUdaSQJNtVdNVFIjSgBc5hpit+GtRmZ+Awl10Do8APzHOH0S15+sjIh2C4YmS59xbiKElOZrxdR/0yejpMNEoyybKW12frQBMoTBHSX9JFBbarTwJJeu5vMbCR3ZRh4Ro/DFBwKe2RIJq51X45KVPUXSu3oM5JuXb32wHs988Rrmq8I7ogVSk/p5SVTSzk72/UrZtsdqB7pjoO24u3u/P9gWJbjDOmrMgmUDjXT0ySpPLTsRO4ybf5/DeyEv4OKOOoELL/S/9pz4u3XlhSXHLvBIOEaz6gfXTzuqG3g6w6caa6IGiaKn0i1hw3vaOzNYh6J5tSEE+NgU7bUl+C7jDU9kSZok+2pVDj+v+9fIXZG9g0Q1TItMzWxFDGyoWiksVv+H741uJB+4AV1JUzSp2UBR5iSoTQ9nbtK97Oe9uquTt1RqDBtr2fUnRUNp+aeJMp8EofCqheUgAtMGu1BTKLy3rWlbcXN95B5HqbkIHmiCcu/6VsXgyyVcGbEfih2hjWCPmUiM6FCfU= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(83380400001)(316002)(6862004)(31696002)(8936002)(86362001)(44832011)(8676002)(31686004)(36756003)(47076005)(36860700001)(16576012)(82310400003)(37006003)(6486002)(70586007)(336012)(2906002)(6666004)(356005)(70206006)(26005)(186003)(53546011)(508600001)(956004)(2616005)(6636002)(5660300002)(15650500001)(81166007)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 14:06:57.5814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2efa362-f987-436e-1f43-08d98a64e3fb X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2471 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-GB Hi Pierre, Thank you for this patch. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 07/10/2021 04:31 PM, Pierre.Gondois@arm.com wrote: > From: Pierre Gondois > > The node creation functions: > - AmlCreateRootNode() > - AmlCreateObjectNode() > - AmlCreateDataNode() > are now resetting the input pointer where the created node is stored. > Thus, it is not necessary to set some local variables to NULL or > check a node value before trying to delete it. > > Signed-off-by: Pierre Gondois > --- > DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c | 6 +----- > DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c | 2 -- > 2 files changed, 1 insertion(+), 7 deletions(-) > > diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c = b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > index 4775b68cd974..cbfd9cbb68b6 100644 > --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > @@ -148,7 +148,6 @@ AmlCodeGenString ( > return EFI_INVALID_PARAMETER; > } > > - ObjectNode =3D NULL; > DataNode =3D NULL; > > Status =3D AmlCreateObjectNode ( > @@ -187,10 +186,7 @@ AmlCodeGenString ( > return Status; > > error_handler: > - if (ObjectNode !=3D NULL) { > - AmlDeleteTree ((AML_NODE_HEADER*)ObjectNode); > - } > - > + AmlDeleteTree ((AML_NODE_HEADER*)ObjectNode); > return Status; > } > > diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c b/Dyn= amicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c > index e09372b039f1..7aafa957a8c4 100644 > --- a/DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c > +++ b/DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c > @@ -43,8 +43,6 @@ AmlCloneNode ( > return EFI_INVALID_PARAMETER; > } > > - *ClonedNode =3D NULL; > - > if (IS_AML_DATA_NODE (Node)) { > DataNode =3D (AML_DATA_NODE*)Node; > Status =3D AmlCreateDataNode ( IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.