From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"daniel.schaefer@hpe.com" <daniel.schaefer@hpe.com>
Cc: Trammell Hudson <hudson@trmm.net>,
"Wang, Jian J" <jian.j.wang@intel.com>,
"Ni, Ray" <ray.ni@intel.com>,
"Gao, Zhichao" <zhichao.gao@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head before registering RAM disk protocol
Date: Tue, 13 Jul 2021 03:44:01 +0000 [thread overview]
Message-ID: <BN8PR11MB366622FBDD9621371062B2DBCA149@BN8PR11MB3666.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210713010931.445739-2-daniel.schaefer@hpe.com>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Daniel
> Schaefer
> Sent: Tuesday, July 13, 2021 9:10 AM
> To: devel@edk2.groups.io
> Cc: Trammell Hudson <hudson@trmm.net>; Daniel Schaefer
> <daniel.schaefer@hpe.com>; Wang, Jian J <jian.j.wang@intel.com>; Wu,
> Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao
> <zhichao.gao@intel.com>
> Subject: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head before
> registering RAM disk protocol
>
> From: Trammell Hudson <hudson@trmm.net>
>
> 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>
Thanks a lot for the fix.
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
I will modify the subject a little bit when merging:
MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk protocol
Best Regards,
Hao Wu
>
> ---
> MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 11 ++++++-
> ----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
> b/MdeModulePkg/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;
> }
>
> + //
> + // 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
> // new handle
> @@ -170,11 +176,6 @@ RamDiskDxeEntryPoint (
> goto ErrorExit;
> }
>
> - //
> - // Initialize the list of registered RAM disks maintained by the driver
> - //
> - InitializeListHead (&RegisteredRamDisks);
> -
> Status = EfiCreateEventReadyToBootEx (
> TPL_CALLBACK,
> RamDiskAcpiCheck,
> --
> 2.31.1
>
>
>
>
>
next prev parent reply other threads:[~2021-07-13 3:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 1:09 [PATCH v1 0/1] RamDiskDxe: Initialize list head before registering RAM disk protocol Daniel Schaefer
2021-07-13 1:09 ` [PATCH v1 1/1] " Daniel Schaefer
2021-07-13 3:44 ` Wu, Hao A [this message]
2021-07-13 9:30 ` [edk2-devel] " Daniel Schaefer
2021-07-14 3:09 ` Wu, Hao A
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BN8PR11MB366622FBDD9621371062B2DBCA149@BN8PR11MB3666.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox