From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.55]) by mx.groups.io with SMTP id smtpd.web10.29270.1585494862735236514 for ; Sun, 29 Mar 2020 08:14:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=2J1gp3Ly; spf=pass (domain: arm.com, ip: 40.107.7.55, 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=F3Su/tqf9kOTHUzzA1yKLSETpHU0wfnOEIsjmbAhOUw=; b=2J1gp3LyFe2R8BeWkQJ12Jgx8xh+FpPwUZq+f92uF+mlVqPsO5yLBxMFWk10k7hHpWkhcEzP3VOsaes0Mgz184hR0JPV9IblK34eZQVGlddTfl/7pn7nzsWNm/CzNuFwcllaRY/d/CwnKndnGfyzjp4FZnL/WPSjjK4jIVvL71E= Received: from AM6PR04CA0069.eurprd04.prod.outlook.com (2603:10a6:20b:f0::46) by VE1PR08MB4863.eurprd08.prod.outlook.com (2603:10a6:802:ac::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.18; Sun, 29 Mar 2020 15:14:19 +0000 Received: from AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:f0:cafe::65) by AM6PR04CA0069.outlook.office365.com (2603:10a6:20b:f0::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20 via Frontend Transport; Sun, 29 Mar 2020 15:14:19 +0000 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=bestguesspass 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 AM5EUR03FT030.mail.protection.outlook.com (10.152.16.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Sun, 29 Mar 2020 15:14:19 +0000 Received: ("Tessian outbound 60d769d68364:v48"); Sun, 29 Mar 2020 15:14:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cd96ed54a72baafc X-CR-MTA-TID: 64aa7808 Received: from bac14d3f59a9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A9A6C375-1C54-460B-A54F-BBC115D59CBE.1; Sun, 29 Mar 2020 15:14:13 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bac14d3f59a9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Sun, 29 Mar 2020 15:14:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bjTXqT1i7YQDjLgdAWxMG4uORBb846s6vmhJsaLv2GNhn+32tTKXJ20QnnOepCMQBoIU1u7C9hqdh5bYVX7bpKZm1WOTWckglH0AQA2F8Fcu9QVjdLXPKos7PxXo3FRmsiy7iFK2hDYpI0RSD2kw6BY6a8LIermNdX5wdWmLsYb94ycuGCyIh51hInxaIeM3mwR+YuiDiYeH3WwO/Vf+Wbplz7gUSBk4Mb4+sT7f4cYSHppp/KcPfW6DtydPOYxp5DLnSL8SSMSe5h02gxNpS4+6Vlng48w03ezlXbXlYq+TZQcnadujqVDaoL2a/5bXcD65C60hBMLTqgE+SCrPxw== 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=F3Su/tqf9kOTHUzzA1yKLSETpHU0wfnOEIsjmbAhOUw=; b=it4gdQRSltHqQp1ihM4h0L5JOHFTashXkRTSHtBvvVWFUtQ5V0e65/rx+DxeIb1d8TbdmIh1sLaMXQOZJkTWFEEvQDVXDdQJRPqgwOt+rimf3z+LK6DadpUs7GVlp72dh/RUSIuPCp3LkQQ3bj7Y+31+V+K1rAyt+WbmNr4cXdadn6+GwonjqgomXBYLTF7+OrUPDqZ7/iLIZ0xaSqByFPIj/837hymyumSLMNwdte3rQgTwT6oxrSdyZ6jFBzjDSrs4Y5OTtXFwhTRgDJLG2ghpmtCufM6H8pbxvK7Qd9wBnfKi4QbbzHwIOpILV5vTeNkcJO9ci4Rwcj1bIRUWgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass 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=F3Su/tqf9kOTHUzzA1yKLSETpHU0wfnOEIsjmbAhOUw=; b=2J1gp3LyFe2R8BeWkQJ12Jgx8xh+FpPwUZq+f92uF+mlVqPsO5yLBxMFWk10k7hHpWkhcEzP3VOsaes0Mgz184hR0JPV9IblK34eZQVGlddTfl/7pn7nzsWNm/CzNuFwcllaRY/d/CwnKndnGfyzjp4FZnL/WPSjjK4jIVvL71E= Received: from VE1PR03CA0012.eurprd03.prod.outlook.com (2603:10a6:802:a0::24) by VI1PR08MB2992.eurprd08.prod.outlook.com (2603:10a6:803:44::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.18; Sun, 29 Mar 2020 15:14:12 +0000 Received: from VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:802:a0:cafe::49) by VE1PR03CA0012.outlook.office365.com (2603:10a6:802:a0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20 via Frontend Transport; Sun, 29 Mar 2020 15:14:12 +0000 Authentication-Results-Original: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT062.mail.protection.outlook.com (10.152.18.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2856.17 via Frontend Transport; Sun, 29 Mar 2020 15:14:11 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Sun, 29 Mar 2020 15:14:08 +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.1779.2; Sun, 29 Mar 2020 15:14:08 +0000 Received: from E107187.Arm.com (10.57.20.21) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Sun, 29 Mar 2020 15:14:07 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , Subject: [PATCH v2 14/16] DynamicTablesPkg: PPTT: Fix uninitialized memory usage Date: Sun, 29 Mar 2020 16:13:51 +0100 Message-ID: <20200329151353.14096-15-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20200329151353.14096-1-sami.mujawar@arm.com> References: <20200329151353.14096-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;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(346002)(376002)(136003)(396003)(39850400004)(46966005)(82740400003)(54906003)(4326008)(36756003)(26005)(316002)(6916009)(186003)(86362001)(47076004)(6666004)(356004)(1076003)(966005)(44832011)(2906002)(7696005)(336012)(5660300002)(70586007)(70206006)(8676002)(8936002)(478600001)(426003)(2616005)(81166006)(81156014);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e42a8d82-8d31-4990-a574-08d7d3f3da82 X-MS-TrafficTypeDiagnostic: VI1PR08MB2992:|VE1PR08MB4863: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-Forefront-PRVS: 035748864E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: fyt1PdhBJRuP3wW2NUZqSHVRxOOVCsQcvm1++CYR7qZTkexl0TJPYgq86bmc90vT2GrlVSgIvPnBsZzq5jSknb/LPJ2hn4qE/1lBTGC4X0RNSglZuZvO3hhQSoThnzFukQVdamkqK9h77itPuNEIetEQ+i6gFt7Tov+qOdgi1wmjXHoE1zCGlAKwtwwxCDMDKRKoxC/bDlO0RaIcjC3+bWj+0iANlRZ/SRpIkJQdGRajFgRzUGbmUoJX/v20DKEKexD2wXg8hkX4dcnvHifbBB/Am9K2ts+1+/0D07jAV33RuHr0PkTQQpotcagd+t8P1V53AcNHAmtPcDqn0qRzug2P5TQH/oq2lcwz4cRBRusyadROpfWyDayT75L3ylHiGfBpv4eovnYiFfGdavsnmAZuf8TPV4YrQnK22OgZ2ssMBg8R6LRW4ASKaNnR5kyCYY7jqszjPQvXUfDtrY7yNGwsaKjn2aD1O3+3nKD6WVfsMq9N6ImM0mNx46o0I2HlA5YHPLdVrYXz7nl8MtJUCE6ZkhdVCd1xNUzCywsYYOZvyzaTQZbMntdZyvtN+afsUZg+kEHIfJU/zZC9uXa12g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2992 Original-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com 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;SFTY:;SFS:(10009020)(4636009)(136003)(396003)(39850400004)(376002)(346002)(46966005)(26005)(8676002)(26826003)(6916009)(44832011)(316002)(81156014)(81166006)(70206006)(2906002)(478600001)(70586007)(8936002)(1076003)(47076004)(426003)(54906003)(4326008)(5660300002)(186003)(86362001)(36906005)(6666004)(966005)(336012)(36756003)(7696005)(82740400003)(2616005);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 45e3ed06-f9fa-43a1-1507-08d7d3f3d620 X-Forefront-PRVS: 035748864E X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TIYlC+Bby7U37Jk3OmTXnaqGKvXe5WR4ckI9fDYC9/8bTRZbU17w5g3eEcG6fGfpH+sTwMDex26otA0GJ5tuKj2Vc3CFnOND/F5Yr6jvBoggU/+lvsK1d7qjHs/fg1kvP9Uo/oIyK/9viouEvmoBHT/MpOSXMXt25d61nq0zVLrci1yJz+7W3Nl+QUp8qWvsXEYgU8C2RRV86kJC961fFOFY7aplHWUp+fVL1n/x3HH0S+PjVZvPSBncTbJevlD33zjMnWAUEN4Zwv4qTlNb3qn1sCnDHqvGO2hbhfDPKwnY2XaxIwx6ZtMgmHDvovGs7JLDUwoVmSlHzf29derSx+R+NMgJ7sKgKOSwtw2cDNbtRGB6yLynIhbvi0Gm6R5ITkthLfHlAt+UZfIQAyJnm/oK/u7CeXt40PDIJNdAnLk7rO6+JgQyB1+keORZhGH9QT0NhPCMMOYTO1wiqWWMFG+XpehJERC5YMSC2+2Cks5siMCpobCP3hsr4b767HzS7IgFlawcUTGqGrId66W/DyvWjuWt5hw7HyjHyEK2/ReQ1hi30uM/HSLQFMtZE5neH6DPy4LU9PCuTMIUdYW9BA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2020 15:14:19.1992 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e42a8d82-8d31-4990-a574-08d7d3f3da82 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: VE1PR08MB4863 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 Reviewed-by: Alexei Fedorov --- Notes: v2: Splitting patch series and re-submitting DynamicTablesPkg [SAMI] patches from https://edk2.groups.io/g/devel/message/46261 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)'