From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (EUR02-AM5-obe.outbound.protection.outlook.com [40.107.0.54]) by mx.groups.io with SMTP id smtpd.web10.32258.1585503484137975557 for ; Sun, 29 Mar 2020 10:38:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=BS51pb+Z; spf=pass (domain: arm.com, ip: 40.107.0.54, 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=vrcZnodo9oeA5EkJovAfB66qSSz90n1c2CpgT3KnTxI=; b=BS51pb+ZY/YVWW+SjiiAO+mH+EznPQU+n0tImQwz38UUGOSrvO8Hy2Gcsc6UJNkWctEOZLzG5VXi2PoR7eBtWK98/BlOCXovWFXhfAD/2mEwaAK4cQb1n+9OMuU29tJ1P+xq8c5EjbTZZ+uUI9kUI5hnbm4ALAKddEx6W7UeI+o= Received: from AM0PR06CA0002.eurprd06.prod.outlook.com (2603:10a6:208:ab::15) by AM0PR08MB2948.eurprd08.prod.outlook.com (2603:10a6:208:5b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Sun, 29 Mar 2020 17:38:01 +0000 Received: from VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:ab:cafe::30) by AM0PR06CA0002.outlook.office365.com (2603:10a6:208:ab::15) 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 17:38:01 +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 VE1EUR03FT044.mail.protection.outlook.com (10.152.19.106) 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 17:38:01 +0000 Received: ("Tessian outbound fb361fb66447:v48"); Sun, 29 Mar 2020 17:38:00 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2479ea69fde19ac0 X-CR-MTA-TID: 64aa7808 Received: from 91026d27973c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CA6FD261-22CC-4778-8C41-129FF6787077.1; Sun, 29 Mar 2020 17:37:55 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 91026d27973c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Sun, 29 Mar 2020 17:37:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f3+dLtB1K9RJRY6DbzwAV14iwfkPXaUgeS3yNNcwnpH708/b4dZ50K+tuamkl1iLI92kZAbqRUE/PJJb2GufnHxuKsif5W9FchKoDfurd7ui2Wq4tBY/0TzWYMKTeMf/r5FWiqNvq0Bu1kHQFvOKBQyOGSx0e24Fmwczuz/pwEiJsT54r3sD7T3ViTDyBRyyeJPpI/9J6lezmUVmoZ02yNoN4vgFKHQLjW2s4KZh6+O8h1IVsjj6/K7llp1YxzEerlaqVz99lgXV96EbA9BzfyWSGwLnRfeY46f6M84Xs3x0KX8/2V/rsaQt08UjHdwOe2PUvMEKyd4cv3+tkxGv4Q== 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=vrcZnodo9oeA5EkJovAfB66qSSz90n1c2CpgT3KnTxI=; b=GtOrEd4tRyU2gd6Lj4bKRxq8zw7I939k7AdEEnsNLEBj4HJGsd+cXUV9/zsxgdjQg/KSboskrXc7u3ZG7RQSY1k5dHjuQkwDL1qUp9a8yo+cj7x0aTkddFhN7OOkKQi+AStM7bb6Nu0nsN43ZoQb2GeYWsj5E5yPdoRBJ7RYaQ0mGt53Ky4uvOmJbqRjAp41FXETB4Gy6IxeJUEsx5FzoEUexxTsRnAJJUHzdTeyr88dYaKozvj8NYduPusRBQuJmdzlTVG2WMvDOpueIuREOpLHz5jeCckoEZavkb2FmIfrMl2rpOs0I4LPkTk8LC7inP/jgLEfKGjv9/Ui8BpUDw== 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=vrcZnodo9oeA5EkJovAfB66qSSz90n1c2CpgT3KnTxI=; b=BS51pb+ZY/YVWW+SjiiAO+mH+EznPQU+n0tImQwz38UUGOSrvO8Hy2Gcsc6UJNkWctEOZLzG5VXi2PoR7eBtWK98/BlOCXovWFXhfAD/2mEwaAK4cQb1n+9OMuU29tJ1P+xq8c5EjbTZZ+uUI9kUI5hnbm4ALAKddEx6W7UeI+o= Received: from AM6PR04CA0028.eurprd04.prod.outlook.com (2603:10a6:20b:92::41) by AM6PR08MB4469.eurprd08.prod.outlook.com (2603:10a6:20b:70::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Sun, 29 Mar 2020 17:37:53 +0000 Received: from VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:92:cafe::45) by AM6PR04CA0028.outlook.office365.com (2603:10a6:20b:92::41) 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 17:37:53 +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 VE1EUR03FT054.mail.protection.outlook.com (10.152.19.64) 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 17:37:53 +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; Sun, 29 Mar 2020 17:37:50 +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 17:37:50 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , Subject: [PATCH v1 2/2] DynamicTablesPkg: SRAT: Fix uninitialized memory usage Date: Sun, 29 Mar 2020 18:37:48 +0100 Message-ID: <20200329173748.7288-3-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20200329173748.7288-1-sami.mujawar@arm.com> References: <20200329173748.7288-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)(376002)(396003)(346002)(136003)(39850400004)(46966005)(7696005)(4326008)(186003)(336012)(2616005)(70586007)(44832011)(5660300002)(2906002)(8936002)(36756003)(426003)(1076003)(26005)(86362001)(82740400003)(47076004)(81166006)(8676002)(6916009)(356004)(81156014)(70206006)(478600001)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e2cba38-8261-40c4-b24c-08d7d407edb3 X-MS-TrafficTypeDiagnostic: AM6PR08MB4469:|AM0PR08MB2948: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-Forefront-PRVS: 035748864E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: U8xXefg+rh9VkJM5oSYvuxHJAIhHK1e5wFgJPKZosiGzUcqp2jkaHUN9fT4L4mPCza/V9Rugnoy/qigIEE1Z6uZDtw/2HceSdJYB5mDIDFovomI+AM8eo8ccW0rF9/vqzJW8dxDsMBH6FNWZEh4Zo7E2SkUl7DB0285GmYuulyaHdOHP/Z4vFKgv2SBYiZntYNIJm3LY7+7uQ/AKB23h/qSt4FepoSNryFYmcs4OgEnpr8p8nZ+HXAcr2tSmJkiLWT644ZWO/fHZ5F5VlcCWu8g92a5JwhbyecTd4S3m+Z/++je5qnXVHOeWaWXghO5cMXh9rzmDuuh7QYCh4MtZTIqIgZz01I2l+x9886yNmRkQxwJ/q9kjwaXF8/0kS98/OT4/yPg86SINcJJaE844cNAQIjIHRFLCnv3ggE6Kh2Kiy5c2irWFjVGfW8k9nBniIx7jH19j4F2zTl+siuDTzhzPWUZOgN6c8+eyr9cxhbbdEnvzs4DCZwZ07pTShA6Z05k616VeC0nHf7kHpX3hxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4469 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: VE1EUR03FT044.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)(346002)(39850400004)(396003)(136003)(376002)(46966005)(36906005)(5660300002)(316002)(54906003)(26826003)(478600001)(86362001)(82740400003)(6916009)(47076004)(44832011)(2616005)(186003)(426003)(336012)(70206006)(70586007)(26005)(1076003)(8676002)(2906002)(36756003)(81166006)(81156014)(8936002)(4326008)(7696005);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: d19c47c5-8ee8-4b20-e7c9-08d7d407e903 X-Forefront-PRVS: 035748864E X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HGK/kf9I0mYRYoW7/FBtMuZ3utWtuGSJ69sm0R/hzhIBjZnQhumb2ohX2jxZZ7M5KOLG72DVB/e6ZboDoqzZ8tAFUlwhIl6zhJx98TCoWB+PyGCC6CH1zjFTTLFal7qlELVFU34rvnVIJHuYmJHKoX8bFdHsjTmbQQdHuASRCBnT/zvX2mNdHQWcifDxUAyZP5JL9lwaHYzGTuF3LhgT+nGnYi3xzW+kQU4JjnOt8IJn551p+EPDvkg63Do3u19IVpr3Il2pkxV4eF98te1kv+jInB+fyL8UOYNjSQEpQ+7mjUpwrXvcgCx6knJofD0uzMvm8pCRHATNByrU6tsIYcH6KCB7xsswiMN5ZNGzqaLkPvEpuFlH+u6zED0h141yH1Rrjbz7+4ZS3V1Pas9aaYjacaCjUdwe0Z5FRB42v9Ojej4YOdswe8sFxzTeyBZKHCxFpxI/G/zi6dG0GJ4iDiu6y3n+mrtCZEl/ytoRVe84MiqPlbcxSNsPze7oQqRYwup1PFiP6iFkK1J/kw9YyA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2020 17:38:01.3020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e2cba38-8261-40c4-b24c-08d7d407edb3 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: AM0PR08MB2948 Content-Type: text/plain On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported for the Status variable in AddGenericInitiatorAffinity() as it is not initialised to a default value. This condition is only valid if GenInitAffCount is equal to 0. Since GenInitAffCount is already checked in BuildSratTable() this condition can never happen. The value of the Status variable is returned in failure cases from appropriate locations in AddGenericInitiatorAffinity(). The only case where Status value is being used un-initialised is the return statement at the end of AddGenericInitiatorAffinity(). Therefore, to fix this issue EFI_SUCCESS can be safely returned instead of returning the Status variable at the end of the function. Signed-off-by: Sami Mujawar --- DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c index 74cb7d92a5d8cddd3df8334f3ab55e6fa3e7267a..620e2929ef2460b6bf318fa85f8bca984608b955 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c @@ -413,7 +413,7 @@ AddGenericInitiatorAffinity ( GenInitAff++; GenInitAffInfo++; }// while - return Status; + return EFI_SUCCESS; } /** Construct the SRAT ACPI table. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'