]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk protocol
authorTrammell Hudson <hudson@trmm.net>
Tue, 13 Jul 2021 01:09:31 +0000 (09:09 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 14 Jul 2021 03:07:48 +0000 (03:07 +0000)
commitd0b6596b8e7ad72c86de0b9faa342a7a866bc87e
tree4dd89421b968024b701229e961dfbc0d70589374
parent9bf4aee7340c331a47d3a60388d478461979a45d
MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk protocol

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3483

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->ForwardLink != ((void *) 0)

Signed-off-by: Trammell Hudson <hudson@trmm.net>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c