Reviewed-by: Ray Ni <ray...@intel.com>

Thanks,
Ray
> -----Original Message-----
> From: Laszlo Ersek <ler...@redhat.com>
> Sent: Wednesday, February 28, 2024 4:47 PM
> To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang....@intel.com>
> Cc: Liming Gao <gaolim...@byosoft.com.cn>; Wu, Jiaxin
> <jiaxin...@intel.com>; Ni, Ray <ray...@intel.com>; Ard Biesheuvel
> <ardb+tianoc...@kernel.org>; Sami Mujawar <sami.muja...@arm.com>
> Subject: Re: [edk2-devel] [PATCH v2 3/4] StandaloneMmPkg: Support to
> unregister MMI handler inside MMI handler
> 
> On 2/28/24 03:27, Zhiguang Liu wrote:
> > To support unregister MMI handler inside MMI handler itself,
> > get next node before MMI handler is executed, since LIST_ENTRY that
> > Link points to may be freed if unregister MMI handler in MMI handler
> > itself.
> >
> > Cc: Liming Gao <gaolim...@byosoft.com.cn>
> > Cc: Jiaxin Wu <jiaxin...@intel.com>
> > Cc: Ray Ni <ray...@intel.com>
> > Cc: Laszlo Ersek <ler...@redhat.com>
> > Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
> > Cc: Sami Mujawar <sami.muja...@arm.com>
> > Signed-off-by: Zhiguang Liu <zhiguang....@intel.com>
> > ---
> >  StandaloneMmPkg/Core/Mmi.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/StandaloneMmPkg/Core/Mmi.c
> b/StandaloneMmPkg/Core/Mmi.c
> > index 0de6fd17fc..c1a1d76e85 100644
> > --- a/StandaloneMmPkg/Core/Mmi.c
> > +++ b/StandaloneMmPkg/Core/Mmi.c
> > @@ -154,9 +154,14 @@ MmiManage (
> >      Head = &MmiEntry->MmiHandlers;
> >    }
> >
> > -  for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {
> > +  for (Link = Head->ForwardLink; Link != Head;) {
> >      MmiHandler = CR (Link, MMI_HANDLER, Link,
> MMI_HANDLER_SIGNATURE);
> > -
> > +    //
> > +    // To support unregister MMI handler inside MMI handler itself,
> > +    // get next node before handler is executed, since LIST_ENTRY that
> > +    // Link points to may be freed if unregister MMI handler.
> > +    //
> > +    Link   = Link->ForwardLink;
> >      Status = MmiHandler->Handler (
> >                             (EFI_HANDLE)MmiHandler,
> >                             Context,
> 
> Reviewed-by: Laszlo Ersek <ler...@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116163): https://edk2.groups.io/g/devel/message/116163
Mute This Topic: https://groups.io/mt/104616994/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to