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>
This commit is contained in:
committed by
mergify[bot]
parent
9bf4aee734
commit
d0b6596b8e
@ -154,6 +154,12 @@ RamDiskDxeEntryPoint (
|
|||||||
goto ErrorExit;
|
goto ErrorExit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialize the list of registered RAM disks maintained by the driver
|
||||||
|
// before installing the protocol
|
||||||
|
//
|
||||||
|
InitializeListHead (&RegisteredRamDisks);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Install the EFI_RAM_DISK_PROTOCOL and RAM disk private data onto a
|
// Install the EFI_RAM_DISK_PROTOCOL and RAM disk private data onto a
|
||||||
// new handle
|
// new handle
|
||||||
@ -170,11 +176,6 @@ RamDiskDxeEntryPoint (
|
|||||||
goto ErrorExit;
|
goto ErrorExit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Initialize the list of registered RAM disks maintained by the driver
|
|
||||||
//
|
|
||||||
InitializeListHead (&RegisteredRamDisks);
|
|
||||||
|
|
||||||
Status = EfiCreateEventReadyToBootEx (
|
Status = EfiCreateEventReadyToBootEx (
|
||||||
TPL_CALLBACK,
|
TPL_CALLBACK,
|
||||||
RamDiskAcpiCheck,
|
RamDiskAcpiCheck,
|
||||||
|
Reference in New Issue
Block a user