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=6+jjBVry; spf=pass (domain: arm.com, ip: 40.107.1.43, mailfrom: sami.mujawar@arm.com) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.43]) by groups.io with SMTP; Fri, 23 Aug 2019 03:58:27 -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=Sbyp5hrEj5iFZxbhb5y/xWVPJW+UmDyuWgEPR24Urtg=; b=6+jjBVryX2/au8yqzdhd0ISBfbtOWQ6d6KfIJiVufgIZsjY2y6+8ZhChqQjPn4kYKEJnWx1ZcZ5QDY4wJVE8HadiLOJk0pNWQdIvUoIN7oYjvi21iqcBPczzdbkTheKHt8tbMd5Ik5J8I/3NULne6pcFMLutmQYA0n5ZUC3xLV4= Received: from AM6PR08CA0044.eurprd08.prod.outlook.com (2603:10a6:20b:c0::32) by AM5PR0801MB1841.eurprd08.prod.outlook.com (2603:10a6:203:2e::7) 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:58:23 +0000 Received: from VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::203) by AM6PR08CA0044.outlook.office365.com (2603:10a6:20b:c0::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.15 via Frontend Transport; Fri, 23 Aug 2019 10:58:22 +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 VE1EUR03FT064.mail.protection.outlook.com (10.152.19.210) 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:58:21 +0000 Received: ("Tessian outbound 4f2e8f9f1994:v27"); Fri, 23 Aug 2019 10:58:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4721cc0a0d9ac3d6 X-CR-MTA-TID: 64aa7808 Received: from ad9096f4aa2a.1 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.12.58]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id DE912E6E-A1AA-4AB7-B27E-FB1B8E9C9801.1; Fri, 23 Aug 2019 10:58:20 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04lp2058.outbound.protection.outlook.com [104.47.12.58]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ad9096f4aa2a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 23 Aug 2019 10:58:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=haD5bXipXoX65r83Pq19E7oG+DzT9scnr5kJL5YZOawx4q9TD4CTPgYyNpTM/6vGl/GjxwcLxKF+uf/pZKnYPKMZqJ+1n4Yn0+2BQXKdXf9kfUUhVnNE0FYjazuL8o9qIsBHwXUMlRGcFj8Uu71+LsQApgcY2+VCv8AeIftZpnIZ/XhN2c339ynm5YdeuH4emt5/O5UIWSjh80ndEp5YZZgrX7sQNvihyUm9VqP/1b6jwzdO0qxghTI6kKjNyg+k8FQmn1r2H4TBH6x7RAznLOH0R0o+/QkeRcNfCm6ok/Q7sQ2k3+wLZNxKOlImCzClc1a8BgLiVJWSnrtSJj6jAQ== 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=Sbyp5hrEj5iFZxbhb5y/xWVPJW+UmDyuWgEPR24Urtg=; b=e7YMqDHMyeKuo2Sw4nLZyxKtnJmMME529Yk5K/op0oApBi0jSHLHa3b7gJRvuCDLvJVjNWysYN93Cj6laWFCDAEyM795NaySd5CsXjDD1cNaOS/zfHN+cqVdaeQ7IglPnLpU5r6uLX/WqgyzGL8aux4SNCDjvVP15zYwEs+rBE+phSGBK98NfqzwdrFsRnjQSnJk4UwYBgSd1XzpaCiYg0PQe5m+edVoB2LzxHRMADSSNv5KLxP7ud32/6Br5inBOXVmzUuSP2u8imypxFVILo0Cj+yt4toGsp8gtV6vbINcrZK+kCeULE1HNLO0UM9ZpqgdtaZhnpSqJSRgfDYLfg== 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=Sbyp5hrEj5iFZxbhb5y/xWVPJW+UmDyuWgEPR24Urtg=; b=6+jjBVryX2/au8yqzdhd0ISBfbtOWQ6d6KfIJiVufgIZsjY2y6+8ZhChqQjPn4kYKEJnWx1ZcZ5QDY4wJVE8HadiLOJk0pNWQdIvUoIN7oYjvi21iqcBPczzdbkTheKHt8tbMd5Ik5J8I/3NULne6pcFMLutmQYA0n5ZUC3xLV4= Received: from AM4PR08CA0077.eurprd08.prod.outlook.com (2603:10a6:205:2::48) by HE1PR0801MB1851.eurprd08.prod.outlook.com (2603:10a6:3:7b::12) 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:58:18 +0000 Received: from AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::208) by AM4PR08CA0077.outlook.office365.com (2603:10a6:205:2::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2199.15 via Frontend Transport; Fri, 23 Aug 2019 10:58:18 +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 AM5EUR03FT045.mail.protection.outlook.com (10.152.17.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:58:16 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Fri, 23 Aug 2019 10:56:27 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Fri, 23 Aug 2019 10:56:25 +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:25 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , Subject: [PATCH v1 14/19] DynamicTablesPkg: PPTT: Fix uninitialized memory usage Date: Fri, 23 Aug 2019 11:55:34 +0100 Message-ID: <20190823105539.13260-15-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)(396003)(39860400002)(136003)(346002)(376002)(2980300002)(189003)(199004)(70206006)(50466002)(48376002)(53416004)(2351001)(86362001)(47776003)(36756003)(356004)(6666004)(2906002)(4326008)(14444005)(53936002)(26005)(305945005)(6916009)(186003)(1076003)(44832011)(51416003)(63350400001)(76176011)(8936002)(11346002)(446003)(63370400001)(126002)(476003)(2616005)(50226002)(426003)(486006)(7696005)(478600001)(81156014)(81166006)(5660300002)(336012)(8676002)(54906003)(70586007)(316002)(16586007);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0801MB1851;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: db122733-cc7e-4a50-235b-08d727b8cfef X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328);SRVR:HE1PR0801MB1851; X-MS-TrafficTypeDiagnostic: HE1PR0801MB1851:|AM5PR0801MB1841: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-Forefront-PRVS: 0138CD935C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: fTPcl1/1vx7DN6LZEMVYAGrP8zga/+xQPOJxF1phQG7XrnQ6LqwY+JIlimzzWQMyjEW8iuqohu/es/q1ZR5Lxe0+s9pJi/tbx1eLxXQ38iw0jfal35BI3r1b4ypRFjXyzYJeWOb/UbNzmzqmyf88yu+XtZAIpigdSMvgNwlYLJgiqNm/dRbHADHrpiLPMI7z3DLwv3Eg+ZUefjDLZz2hEG8uFEjlhmwmvMcB+P0o2IIvncpM2TMPBnnIV63dRX/JlBTcQk7EF6legWY2CMng8KGE6EjsM872crj2Yw1M8Txd2IBjDcbZpaszwQFKAmE45CvbjTJboOeoSLInWPBPuJpHug/NlEUJQkxoiUnFgLoo7fm4Bj0Q5d7Sz/dABJxjCYcuEFA/xw4w4K/RD8GZxgZRH2VA6OtwFvlvfjUOfM8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1851 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: VE1EUR03FT064.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)(136003)(39860400002)(346002)(376002)(396003)(2980300002)(199004)(189003)(26005)(2351001)(2906002)(50226002)(26826003)(53416004)(478600001)(186003)(76130400001)(51416003)(7696005)(16586007)(8936002)(76176011)(54906003)(36906005)(70586007)(316002)(81156014)(81166006)(70206006)(8676002)(50466002)(4326008)(305945005)(44832011)(6666004)(86362001)(426003)(336012)(48376002)(63350400001)(22756006)(486006)(126002)(476003)(63370400001)(11346002)(446003)(6916009)(5660300002)(1076003)(47776003)(2616005)(14444005)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0801MB1841;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;A:1;MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 471806c3-c6c2-47e3-a731-08d727b8cd35 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(710020)(711020)(4605104)(1401327)(2017052603328);SRVR:AM5PR0801MB1841; NoDisclaimer: True X-Forefront-PRVS: 0138CD935C X-Microsoft-Antispam-Message-Info: r7BNkIE8aIxlUlbWgQmJbEn7vEugQZGk7CwLt97gEWvi2u/434ntjJDB1u2eZ0mGl1XVAKp1lfc+cOilwzM1O9Y3nKEJTfUvdJ9hUWbbtLCNStVWX6HHTqk28CLVYXKHKM/CzMEpvU9Inki4HNnjobehfQIjnJDiME8ssN3ZLTTEc9m9BlR5F5K4H++x9s+yZwmTgDjJEUyFA9IhwBGUct47d0AXqbGwDBhO9sAfZE6MpiGp/w3jrKmiI9DdLMR41wny9CgjAZ626ZJxOrXsi/RmtqvVwOgiT5Ycp6aYgLCkhq3Lf0QdoAx8HFTgh4HSkXjZNilbcAnDH3FHylNL71E9GvjBqOnQY3FTXO0OcJtbrIL/LzxgVGo7rRx9iwEXDeK7b6H/XQH/qHSmYJnkmwFRmBJ43aBukkiqPGBEBlg= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2019 10:58:21.0394 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db122733-cc7e-4a50-235b-08d727b8cfef 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: AM5PR0801MB1841 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/AcpiPpttLibArm/PpttGenerator.c | 59 ++++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c index 82070403ac8757f54e839fd00eb4acb3292fc60c..d70fc59e754e7d348965b8c3739822a9f1c4b7e6 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c @@ -1203,6 +1203,17 @@ BuildPpttTable ( Generator->ProcHierarchyNodeCount, &NodeIndexer ); + + DEBUG (( + DEBUG_INFO, + " ProcHierarchyNodeCount = %d\n" \ + " ProcHierarchyNodeOffset = 0x%x\n" \ + " ProcHierarchyNodeIndexedList = 0x%p\n", + Generator->ProcHierarchyNodeCount, + ProcHierarchyNodeOffset, + Generator->ProcHierarchyNodeIndexedList + )); + } // Include the size of Cache Type Structures and index them @@ -1215,6 +1226,15 @@ BuildPpttTable ( Generator->CacheStructCount, &NodeIndexer ); + DEBUG (( + DEBUG_INFO, + " CacheStructCount = %d\n" \ + " CacheStructOffset = 0x%x\n" \ + " CacheStructIndexedList = 0x%p\n", + Generator->CacheStructCount, + CacheStructOffset, + Generator->CacheStructIndexedList + )); } // Include the size of ID Type Structures and index them @@ -1227,6 +1247,15 @@ BuildPpttTable ( Generator->IdStructCount, &NodeIndexer ); + DEBUG (( + DEBUG_INFO, + " IdStructCount = %d\n" \ + " IdStructOffset = 0x%x\n" \ + " IdStructIndexedList = 0x%p\n", + Generator->IdStructCount, + IdStructOffset, + Generator->IdStructIndexedList + )); } DEBUG (( @@ -1238,36 +1267,6 @@ BuildPpttTable ( TableSize )); - DEBUG (( - DEBUG_INFO, - " ProcHierarchyNodeCount = %d\n" \ - " ProcHierarchyNodeOffset = 0x%x\n" \ - " ProcHierarchyNodeIndexedList = 0x%p\n", - Generator->ProcHierarchyNodeCount, - ProcHierarchyNodeOffset, - Generator->ProcHierarchyNodeIndexedList - )); - - DEBUG (( - DEBUG_INFO, - " CacheStructCount = %d\n" \ - " CacheStructOffset = 0x%x\n" \ - " CacheStructIndexedList = 0x%p\n", - Generator->CacheStructCount, - CacheStructOffset, - Generator->CacheStructIndexedList - )); - - DEBUG (( - DEBUG_INFO, - " IdStructCount = %d\n" \ - " IdStructOffset = 0x%x\n" \ - " IdStructIndexedList = 0x%p\n", - Generator->IdStructCount, - IdStructOffset, - Generator->IdStructIndexedList - )); - // Allocate the Buffer for the PPTT table *Table = (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize); if (*Table == NULL) { -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'