MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk protocol #1814
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Patch sent at: https://edk2.groups.io/g/devel/message/77723
Cover letter: https://edk2.groups.io/g/devel/message/77722
Sending this patch on behalf of Trammell, who asked me to do so, so that he doesn't have to set up git-send-email config.
See his PR: #1810
Trammell Hudson (1):
RamDiskDxe: initialize list head before registering ram disk protocol
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Commit message:
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