From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=HY1FkVQE; spf=pass (domain: arm.com, ip: 40.107.8.70, mailfrom: sami.mujawar@arm.com) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.70]) by groups.io with SMTP; Fri, 23 Aug 2019 03:56:57 -0700 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=2ZmjvLEFmj3MbNSDzvc+7FXelayibRvCz4hEhJi6FiA=; b=HY1FkVQEiirECAv1qcejgYynQGotQzTFLvuAhv8MjVP9o4RU2ym0NgMppkGGi43Z35gC1wQeGys+ViuTUomqS8nXna94sgnOljHmTSV+tBvGtTfZmgafhoHBNK/T1aUTVoFzG1hZpp8ocFRTyzJjd9aeYSHiTD72IoF0rF3xFCw= Received: from VI1PR08CA0089.eurprd08.prod.outlook.com (10.175.228.15) by HE1PR0802MB2603.eurprd08.prod.outlook.com (10.175.35.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Fri, 23 Aug 2019 10:56:52 +0000 Received: from AM5EUR03FT047.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::208) by VI1PR08CA0089.outlook.office365.com (2603:10a6:800:d3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.14 via Frontend Transport; Fri, 23 Aug 2019 10:56:52 +0000 Authentication-Results: spf=temperror (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=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT047.mail.protection.outlook.com (10.152.16.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:56:51 +0000 Received: ("Tessian outbound 3aa685aedf5f:v27"); Fri, 23 Aug 2019 10:56:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0c9e0a03926dd5e2 X-CR-MTA-TID: 64aa7808 Received: from cdf396dba65d.1 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.0.52]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9F0AD989-423E-410B-A290-2DB34F5D9928.1; Fri, 23 Aug 2019 10:56:46 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01lp2052.outbound.protection.outlook.com [104.47.0.52]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cdf396dba65d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 23 Aug 2019 10:56:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Acctm7D7352mZPSFzlv+q7WtAPoiEPp/AKzwg0aA+cHjnzamEGj2z/2GyoSDOUXM5H5NAaaOTkOYoWcBEODqn+9Zl2HQGgiqyaDA0aZciUUqot9vST87UKTpIfQtZX2qwu4nICcpCdoMXXGYXF3m/Kd6IIGj2Vz2vCzwlq/u2hvBbqG21eTVFT08nijmxr8Z/7nSJjvUFpxqw9hoRtSfCsLFC/IJwe47Ee7vTO3YtulBOjRLjDLYWofUb/ERq2RXvaT9E7WcFg2S3idsPubthfsdMlzVa6UmZ4snyaKgguvn4yAAASo3E8yPXx76prfuUKs+zmM4j4WWeaw1xW19PA== 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-SenderADCheck; bh=2ZmjvLEFmj3MbNSDzvc+7FXelayibRvCz4hEhJi6FiA=; b=K/HhSw1kcY6FGiOAXtvjbYO+vNYNpef1+skdliEx/qbbmLfLXlGNK3R6yUyKBdc8Zodd6p2wX0XpLWiJyRgnQGPId/GdJDQCPa9h8DiiLtNFl7hhQGB1RXs6TrwuW+22OchX+X4EKTjTnaq5HFHPU8aJGXadVrYqa2/NvywnXwFs5FA/5U5Dsq21WfnRpcz/NoSmzKqOg+fcffPVGxC6fcQTCod465ELZ+21pqaZbX/lNxAipbTd1nVss9K6s1rwiVRwLUrT0shq3lU8l8Ht29OfH1HSAXvGXAmzZv6F3d59HU7JGDsiXvEM+4HA4GJArLuYUbW6Gqp4KkRDHHlhfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=temperror action=none header.from=arm.com; dkim=none (message not signed); 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=2ZmjvLEFmj3MbNSDzvc+7FXelayibRvCz4hEhJi6FiA=; b=HY1FkVQEiirECAv1qcejgYynQGotQzTFLvuAhv8MjVP9o4RU2ym0NgMppkGGi43Z35gC1wQeGys+ViuTUomqS8nXna94sgnOljHmTSV+tBvGtTfZmgafhoHBNK/T1aUTVoFzG1hZpp8ocFRTyzJjd9aeYSHiTD72IoF0rF3xFCw= Received: from HE1PR0802CA0009.eurprd08.prod.outlook.com (2603:10a6:3:bd::19) by AM6PR08MB4952.eurprd08.prod.outlook.com (2603:10a6:20b:e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Fri, 23 Aug 2019 10:56:42 +0000 Received: from AM5EUR03FT025.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::205) by HE1PR0802CA0009.outlook.office365.com (2603:10a6:3:bd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.14 via Frontend Transport; Fri, 23 Aug 2019 10:56:42 +0000 Authentication-Results-Original: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT025.mail.protection.outlook.com (10.152.16.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:56:41 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Fri, 23 Aug 2019 10:56:24 +0000 Received: from E107187.Arm.com (10.1.195.55) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Fri, 23 Aug 2019 10:56:24 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , Subject: [PATCH v1 13/19] DynamicTablesPkg: IORT: Fix uninitialized memory usage Date: Fri, 23 Aug 2019 11:55:33 +0100 Message-ID: <20190823105539.13260-14-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20190823105539.13260-1-sami.mujawar@arm.com> References: <20190823105539.13260-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;IPV:NLI;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(396003)(346002)(376002)(136003)(2980300002)(189003)(199004)(2616005)(11346002)(50226002)(4326008)(36756003)(478600001)(356004)(26005)(336012)(53936002)(81156014)(81166006)(305945005)(2351001)(6666004)(14444005)(8676002)(70206006)(6916009)(70586007)(1076003)(47776003)(86362001)(476003)(63350400001)(76176011)(446003)(486006)(426003)(44832011)(316002)(126002)(51416003)(54906003)(48376002)(50466002)(186003)(2906002)(5660300002)(8936002)(63370400001)(16586007)(7696005)(53416004);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR08MB4952;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dcf6f3d9-7d14-4bbc-ac29-08d727b89a74 X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600166)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328);SRVR:AM6PR08MB4952; X-MS-TrafficTypeDiagnostic: AM6PR08MB4952:|HE1PR0802MB2603: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true X-MS-Oob-TLC-OOBClassifiers: OLM:5516;OLM:5516; X-Forefront-PRVS: 0138CD935C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: OYMtaLLgESvKMxw53xKGw02oFMqjB7O5A7AHjfMHXOBBElKv47Ce6M8t9DDerRUuILbpknLIEnekDq7rJJ+EyRcgYzRPGYhyq4Jk2+mS6BruZZ/3QnSFMoZz94SvjfLNjByQyVOkhwzkde9DATCaXgv8mN93BzJOq3+MxjVVEuSpVnc7GGSihA7skztBKMKoJNdzjxdekGpuM884BZC0WpFyVCTxX7BnfkbIkjvyrMcd/dR1nRHQIfmDyU/w7GaMHh1QHwagCJmNWm1TlJD2IJ0k73lsRB5Iqi6FI39pB0dm94v3KCodPL3hxFFqNC16Bmyl/bxFcoJmwlloKR2hqPibnFjAKEv53syEQJgcX9HaCaZXv+cr8wndY02QP6nYY1PZmqkjvswTibICD4VjwhfNWpsPEAfZaLh87oZmRLE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4952 Original-Authentication-Results: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT047.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;IPV:CAL;SCL:-1;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(376002)(396003)(39860400002)(346002)(136003)(2980300002)(189003)(199004)(2616005)(76176011)(14444005)(86362001)(22756006)(6916009)(70206006)(70586007)(1076003)(16586007)(81156014)(54906003)(7696005)(51416003)(81166006)(47776003)(316002)(8936002)(8676002)(36906005)(305945005)(186003)(26005)(36756003)(336012)(50466002)(2906002)(50226002)(4326008)(6666004)(5660300002)(76130400001)(2351001)(53416004)(63370400001)(478600001)(63350400001)(11346002)(446003)(426003)(44832011)(26826003)(126002)(48376002)(486006)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0802MB2603;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;MX:1;A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 14eec2a1-cffb-4e68-ae77-08d727b8945c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(710020)(711020)(4605104)(1401327)(2017052603328);SRVR:HE1PR0802MB2603; NoDisclaimer: True X-Forefront-PRVS: 0138CD935C X-Microsoft-Antispam-Message-Info: eSRvGFfiX7QpPADj12N9e+JliNXqIwhDGGvJd891nPMuAOpJaV7Pnyh+pEldresJaWjrolXVcY7E8gKmP+VLtAyMUpaeNwpftL22yj69fZbEkjnaaklxtWrwSBNbjL5p3o0OSKswrQnMYrgx6w6HL9Kee0YLpg4rtPGQ+2xQ3JiLAqRDOCNxN+AhP9IXEl4SiB06W1Df8VspZ94eF5aI8TpGCJY29wjzxBjbwzUefKNs05nI0iTh96SqOfypoV0H4zgPjZZ2YToEoqXUpmyT7bnwaSq5ThPZpAT32RnpP7qntexfbDKJoS3qwQK12QxmwwsF2QFe9Kb32nVbkBXo7YBY/DY6wh/xEkEp6rqnkF4Z6ZmLdtzYobqEarHjoAaWlyz97nyf3WyMPInnM4fBFBWWtV94ol050OYG3wvJqrk= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2019 10:56:51.4287 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dcf6f3d9-7d14-4bbc-ac29-08d727b89a74 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2603 Content-Type: text/plain On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported as some variables that were being logged were uninitialised. To fix this, moved the logging code after the variables being logged are initialised. Signed-off-by: Sami Mujawar --- DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 96 ++++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index bd71220ca19679792de2bb6d88eed8d1913a7600..65d006c89e668c8b2b8a14326cddf1b69979597f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -1738,6 +1738,14 @@ BuildIortTable ( goto error_handler; } TableSize += NodeSize; + + DEBUG (( + DEBUG_INFO, + " ItsGroupNodeCount = %d\n" \ + " ItsGroupOffset = %d\n", + ItsGroupNodeCount, + ItsGroupOffset + )); } // Named Component Nodes @@ -1760,6 +1768,14 @@ BuildIortTable ( goto error_handler; } TableSize += NodeSize; + + DEBUG (( + DEBUG_INFO, + " NamedComponentNodeCount = %d\n" \ + " NamedComponentOffset = %d\n", + NamedComponentNodeCount, + NamedComponentOffset + )); } // Root Complex Nodes @@ -1782,6 +1798,14 @@ BuildIortTable ( goto error_handler; } TableSize += NodeSize; + + DEBUG (( + DEBUG_INFO, + " RootComplexNodeCount = %d\n" \ + " RootComplexOffset = %d\n", + RootComplexNodeCount, + RootComplexOffset + )); } // SMMUv1/SMMUv2 Nodes @@ -1804,6 +1828,14 @@ BuildIortTable ( goto error_handler; } TableSize += NodeSize; + + DEBUG (( + DEBUG_INFO, + " SmmuV1V2NodeCount = %d\n" \ + " SmmuV1V2Offset = %d\n", + SmmuV1V2NodeCount, + SmmuV1V2Offset + )); } // SMMUv3 Nodes @@ -1826,6 +1858,14 @@ BuildIortTable ( goto error_handler; } TableSize += NodeSize; + + DEBUG (( + DEBUG_INFO, + " SmmuV3NodeCount = %d\n" \ + " SmmuV3Offset = %d\n", + SmmuV3NodeCount, + SmmuV3Offset + )); } // PMCG Nodes @@ -1848,6 +1888,14 @@ BuildIortTable ( goto error_handler; } TableSize += NodeSize; + + DEBUG (( + DEBUG_INFO, + " PmcgNodeCount = %d\n" \ + " PmcgOffset = %d\n", + PmcgNodeCount, + PmcgOffset + )); } DEBUG (( @@ -1859,54 +1907,6 @@ BuildIortTable ( TableSize )); - DEBUG (( - DEBUG_INFO, - " ItsGroupNodeCount = %d\n" \ - " ItsGroupOffset = %d\n", - ItsGroupNodeCount, - ItsGroupOffset - )); - - DEBUG (( - DEBUG_INFO, - " NamedComponentNodeCount = %d\n" \ - " NamedComponentOffset = %d\n", - NamedComponentNodeCount, - NamedComponentOffset - )); - - DEBUG (( - DEBUG_INFO, - " RootComplexNodeCount = %d\n" \ - " RootComplexOffset = %d\n", - RootComplexNodeCount, - RootComplexOffset - )); - - DEBUG (( - DEBUG_INFO, - " SmmuV1V2NodeCount = %d\n" \ - " SmmuV1V2Offset = %d\n", - SmmuV1V2NodeCount, - SmmuV1V2Offset - )); - - DEBUG (( - DEBUG_INFO, - " SmmuV3NodeCount = %d\n" \ - " SmmuV3Offset = %d\n", - SmmuV3NodeCount, - SmmuV3Offset - )); - - DEBUG (( - DEBUG_INFO, - " PmcgNodeCount = %d\n" \ - " PmcgOffset = %d\n", - PmcgNodeCount, - PmcgOffset - )); - if (TableSize > MAX_UINT32) { Status = EFI_INVALID_PARAMETER; DEBUG (( -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'