Re: [edk2-devel] 回复: [PATCH] MdeModulePkg: Initialize local variable value before they are used

Wu, Hao A hao.a.wu at intel.com
Thu Mar 11 01:32:42 UTC 2021


> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of gaoliming
> Sent: Thursday, March 11, 2021 9:10 AM
> To: Wu, Hao A <hao.a.wu at intel.com>; devel at edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang at intel.com>
> Subject: [edk2-devel] 回复: [PATCH] MdeModulePkg: Initialize local variable
> value before they are used
> 
> Hao:
>   Yes. I agree. I will add this information when I merge it.


Hello Liming,

Thanks a lot.

Best Regards,
Hao Wu


> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: Wu, Hao A <hao.a.wu at intel.com>
> > 发送时间: 2021年3月9日 10:10
> > 收件人: Liming Gao <gaoliming at byosoft.com.cn>; devel at edk2.groups.io
> > 抄送: Wang, Jian J <jian.j.wang at intel.com>
> > 主题: RE: [PATCH] MdeModulePkg: Initialize local variable value before
> they
> > are used
> >
> > > -----Original Message-----
> > > From: Liming Gao <gaoliming at byosoft.com.cn>
> > > Sent: Tuesday, March 9, 2021 9:24 AM
> > > To: devel at edk2.groups.io
> > > Cc: Wang, Jian J <jian.j.wang at intel.com>; Wu, Hao A
> > <hao.a.wu at intel.com>
> > > Subject: [PATCH] MdeModulePkg: Initialize local variable value before
> they
> > are
> > > used
> > >
> > > This change is to fix the compiler error on GCC49 release build.
> >
> >
> > Thanks Liming. The patch looks good to me:
> > Reviewed-by: Hao A Wu <hao.a.wu at intel.com>
> >
> > I have one question that I think both the reports are false positives.
> > Do you think it will be better to add this information in the commit
> message?
> >
> > Best Regards,
> > Hao Wu
> >
> >
> > >
> > > Cc: Jian J Wang <jian.j.wang at intel.com>
> > > Cc: Hao A Wu <hao.a.wu at intel.com>
> > > Signed-off-by: Liming Gao <gaoliming at byosoft.com.cn>
> > > ---
> > >  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > | 1 +
> > >  .../Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c    | 1 +
> > >  2 files changed, 2 insertions(+)
> > >
> > > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > > b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > > index e99a812a44..0779f94f9e 100644
> > > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > > @@ -1122,6 +1122,7 @@ AhciDmaTransfer (
> > >
> > >    Map   = NULL;
> > >    PciIo = Instance->PciIo;
> > > +  Status = EFI_SUCCESS;
> > >
> > >    if (PciIo == NULL) {
> > >      return EFI_INVALID_PARAMETER;
> > > diff --git
> > >
> > a/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
> > >
> > b/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
> > > index 0c9299c8b0..7822cbf4bb 100644
> > > ---
> > >
> > a/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
> > > +++
> > >
> > b/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
> > > @@ -117,6 +117,7 @@ CreateBasicVariablePolicy (
> > >
> > >    // Now we've gotta determine the total size of the buffer required
> for
> > >    // the VariablePolicy structure.
> > > +  NameSize  = 0;
> > >    TotalSize = sizeof( VARIABLE_POLICY_ENTRY );
> > >    if (Name != NULL) {
> > >      NameSize = StrnSizeS( Name, MAX_UINT16 );
> > > --
> > > 2.27.0.windows.1
> > >
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72656): https://edk2.groups.io/g/devel/message/72656
Mute This Topic: https://groups.io/mt/81243567/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list