Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk protocol #1814

Merged
merged 1 commit into from Jul 14, 2021

Conversation

hwu25
Copy link
Member

@hwu25 hwu25 commented Jul 14, 2021

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

…otocol

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>
@hwu25 hwu25 added the push Auto push patch series in PR if all checks pass label Jul 14, 2021
@mergify mergify bot merged commit d0b6596 into tianocore:master Jul 14, 2021
@hwu25 hwu25 deleted the push_ramdisk_listinit branch August 30, 2022 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants