From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.2932.1626138634380919640 for ; Mon, 12 Jul 2021 18:10:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=S2GJONZc; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=08282ce170=daniel.schaefer@hpe.com) Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16D14wnO030883; Tue, 13 Jul 2021 01:10:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=pps0720; bh=HP8eeNK4X5zdnVljQCQcMDXdESluhHQUhRzaOoNc4ZE=; b=S2GJONZcmSeoQ/9DScyADVNiQy7dSJDgs9uM6xW6O944vi471aJMrr2xMn/XgY4DQap3 BOlYe7+VqB41Z2xZXD+HXAkQ67Zd3MGKN+RWGMHy8MDZUizEyDH4ycf1Kej7+VOFyj0k +n1TdDy6ism0HAWmtRCf8cZpK/0LcDYZ006Vdmp0+9XQuhdxaFTZAFj/na8LvZRjPTI+ GaZ1D6XxK+Ti4cDe7MC9yQ5eQXJkF4URSm9aT7HH1ltLrMk3gXifWsZj5TyiQpaE/StC eZ5C+IYME1ijbdRIklokWTxBZTRHzBNoZildlvWcHxKo4+hJjOWljBWNxMU1pNvtGFFc fA== Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 39rmk268sr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jul 2021 01:10:33 +0000 Received: from G1W8106.americas.hpqcorp.net (g1w8106.austin.hp.com [16.193.72.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5008.houston.hpe.com (Postfix) with ESMTPS id 4F30953; Tue, 13 Jul 2021 01:10:32 +0000 (UTC) Received: from G9W8674.americas.hpqcorp.net (16.220.49.0) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 13 Jul 2021 01:10:04 +0000 Received: from G4W10204.americas.hpqcorp.net (2002:10cf:5210::10cf:5210) by G9W8674.americas.hpqcorp.net (2002:10dc:3100::10dc:3100) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 13 Jul 2021 01:10:03 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (15.241.52.13) by G4W10204.americas.hpqcorp.net (16.207.82.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18 via Frontend Transport; Tue, 13 Jul 2021 01:10:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QCuDfsB06YiNCj+1Nj9K9nH2ewu6xnIM0hSIn8A5DOoRybgPxsuVEEECAvJuKgYV/y5c/8oECEVWY2cxhLw8Cvzo1T0Y9ncO7Yc5P7dtBqKbgKTQrvkKnG+C9kbMn7KJ9qFYdJscXfFFqfRQ6M5E03uDK3i6iG6XJy0XHyHTzq/knA+CPQiQ65uu8/jI5+JZ4rSXb8cfbqw8j1iWX9iELYsuF1iCWfjfDHkR3qs0VgYiiUhAKmE8c20kwDfTETeREYOZZ3iSKu/93t+YQ/NSRc4RJwKZFD1z4NXyDnfwbedy1nMv65c/W/2HndTL3LIGCj5GevL6DBh40JP26/Juiw== 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=HP8eeNK4X5zdnVljQCQcMDXdESluhHQUhRzaOoNc4ZE=; b=Dno+WobsOjXRD7Um/uLB5hqZhYwLVDdbiQmjD4eccAIfXt66LpxqP9enlD+w2dQyZrELQAxnd1d9u0NjsCL0tuyIdFzr+4SEynZDKiLY0KzW5OSXO2HO5ENHgZo0qmgtu43ZRXj9MG6NAnyWUzOl8NiycWNduWiEv62gmGR7KhiPVbDXc8hLHjfyIzMoynV4PIsGKPrXSOG2dWnCjjOYmCQXyaCdupO6as5+7hwiw910Wtv+743/Gaaun9q9IjHfktbY0Y2/MuoA9rSKSlZoXHxKz99+1m3Chz/raajx7iV2dadtHNpyRPE3c4q0SaWYWGi7zQ4VU7XFeWhFVYT/BA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) by DF4PR8401MB1100.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7611::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Tue, 13 Jul 2021 01:10:02 +0000 Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::c804:b24:831b:272a]) by DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::c804:b24:831b:272a%5]) with mapi id 15.20.4308.027; Tue, 13 Jul 2021 01:10:02 +0000 From: "Daniel Schaefer" To: CC: Trammell Hudson , Daniel Schaefer , Jian J Wang , Hao A Wu , Ray Ni , Zhichao Gao Subject: [PATCH v1 1/1] RamDiskDxe: Initialize list head before registering RAM disk protocol Date: Tue, 13 Jul 2021 09:09:31 +0800 Message-ID: <20210713010931.445739-2-daniel.schaefer@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210713010931.445739-1-daniel.schaefer@hpe.com> References: <20210713010931.445739-1-daniel.schaefer@hpe.com> X-ClientProxiedBy: SA9PR13CA0168.namprd13.prod.outlook.com (2603:10b6:806:28::23) To DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (123.193.59.220) by SA9PR13CA0168.namprd13.prod.outlook.com (2603:10b6:806:28::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.10 via Frontend Transport; Tue, 13 Jul 2021 01:10:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5271e6a-f139-41c8-8fda-08d9459af136 X-MS-TrafficTypeDiagnostic: DF4PR8401MB1100: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xNGTEc4Gh9qMC2nAnGBDy+ZFNTyPi1OO+byx/wjvniUcdNFQwaLSzQ24TctT4Bt2eBzZlxmi9kBWkvEId1RoAj2DIDLJRCgwWTu/06tKy0DGjSUGcUqhdkq1JF719nUzrYtD4b0P3/IMNFUgJI+PYcYokrhSPcYchb/ZUvI4Dn0G5EWjbqH+abrdQjvd4LOiZ+yNbpYQ0k22x/+/1Cgv6SfDrV3rKojf+qWJ2S9ZzCYY5YFP1oMW5L7PlGK5zsZ4cI7XFKrgv5WjKtUlLr3ASyZt7tJccOQD2YhorukdCTumEmyNHyYNva1scwiUHyOKn/YnkP7KV/cpBOUa9WE1J0N43kRTpPdq4NM/Cq7OWpUQdte11MyQC9+RElj+D6C/v/6zzvSiH+X7k8L342r5v1oko5b4MQTsptsjDwq4fm+qOF3RNFrrzjBqH9dGbynShkvcjm6ufhQI9rymIr5wVomSIQqG2mlTHHx5I/OO5L7RLqlJPcuJYb21ecZF6gyWmin+5UrhWG4OftCeVDOqSytc6gqd2/iR2MAVnfCWp8uTIFftspoRUvdYdngfGRWTK0ID6vof40o4LXIC7vlVNK89fmJDXSaFyEVmQXtIP8QstWE/e52PieNn+GfcCzmXpl6X+46SNeAp5mQfOZqGQGdma/WF2WHRIAbNSsV+ihbYLlzS4seESkLrQerWThO26OD98LXvgXZ2xCmhaU+NRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(376002)(136003)(396003)(39860400002)(346002)(38100700002)(86362001)(316002)(8676002)(6486002)(66476007)(66556008)(66946007)(2906002)(38350700002)(52116002)(6916009)(4326008)(83380400001)(478600001)(54906003)(1076003)(44832011)(2616005)(956004)(26005)(36756003)(6512007)(5660300002)(8936002)(6666004)(6506007)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0yz/HyBLh0lUpGgwMVlR/sUgKxDfsO7xBVO6QiAr0GFjRgX5FwlfvhypKmEp?= =?us-ascii?Q?XGlSWTR4rAYc79IOGSaY+SBfETNHXB4tF9z9sSZzaZ1VPfr2/2gjmAbfiOgv?= =?us-ascii?Q?4Djz2d69ZXILU+iI9lxpqSzB39rjuMYnu/mh4e2UdJQjcrBloePmOtb71UoY?= =?us-ascii?Q?+8rm1CP3DvWQ1By3jLV+vv/XLdbyJXKb4EI5gczuI9kbjORN2ekHbZvjFk6W?= =?us-ascii?Q?W5cUGlW0tDjKKuP3IRe8n+c0eBws+nGbLNCiHHtmw//kN8Y+aiNP4dcmJXIT?= =?us-ascii?Q?7ZUEX9xUaFWcYVPvA6N6/EN0Xc4CQI9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qN+fp6F6pA1DJVnKnG2GOB8NwpWKTtPxDjRUxc+P6EWij/KFNuaWi2t3RG?= =?us-ascii?Q?7a1pkXAzEVYT24Xbk3ufac4Ilx1E1ceZd3rQiiPgvAuF/E0zBtWFWXIxdR01?= =?us-ascii?Q?FXQZFVTd2/UB+TWT5OUe+X1N?= X-MS-Exchange-CrossTenant-Network-Message-Id: c5271e6a-f139-41c8-8fda-08d9459af136 X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 01:10:02.6769 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nFOqSiW6luY94Xws12SxK8aGaccDQ4YfAV6xhM3qHips6kXX1VgekffaicF4ttVH/j7GnuVMfIBIb03dJd2pNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB1100 X-OriginatorOrg: hpe.com X-Proofpoint-ORIG-GUID: U4i4S0VrAnQpq8eovkW74fkgWgbWxUnO X-Proofpoint-GUID: U4i4S0VrAnQpq8eovkW74fkgWgbWxUnO X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-12_14:2021-07-12,2021-07-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=967 priorityscore=1501 impostorscore=0 malwarescore=0 phishscore=0 clxscore=1015 adultscore=0 bulkscore=0 mlxscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107130005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Trammell Hudson This patch initializes the linked list RegisteredRamDisks in RamDiskDxeEntryPoint before the registration of gEfiRamDiskProtocolGuid with InstallMultipleProtocolInterfaces, allowing ramdisks to be created via a callback installed with RegisterProtocolNotify as soon as the protocol is registered. Without this, calling RamDisk->Register() in the callback causes a crash: ASSERT [RamDiskDxe] MdePkg/Library/BaseLib/LinkedList.c(75): List->ForwardL= ink !=3D ((void *) 0) Signed-off-by: Trammell Hudson Cc: Daniel Schaefer Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Zhichao Gao --- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c b/MdeMo= dulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c index fcbf4f117dc6..13e2aed87cef 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c @@ -154,6 +154,12 @@ RamDiskDxeEntryPoint ( goto ErrorExit;=0D }=0D =0D + //=0D + // Initialize the list of registered RAM disks maintained by the driver= =0D + // before installing the protocol=0D + //=0D + InitializeListHead (&RegisteredRamDisks);=0D +=0D //=0D // Install the EFI_RAM_DISK_PROTOCOL and RAM disk private data onto a=0D // new handle=0D @@ -170,11 +176,6 @@ RamDiskDxeEntryPoint ( goto ErrorExit;=0D }=0D =0D - //=0D - // Initialize the list of registered RAM disks maintained by the driver= =0D - //=0D - InitializeListHead (&RegisteredRamDisks);=0D -=0D Status =3D EfiCreateEventReadyToBootEx (=0D TPL_CALLBACK,=0D RamDiskAcpiCheck,=0D --=20 2.31.1