[edk2-devel] [PATCH v2 1/3] MdeModulePkg/EhciPei: Initialize the variable Map

Zhang, Shenglei posted 3 patches 6 years, 3 months ago
[edk2-devel] [PATCH v2 1/3] MdeModulePkg/EhciPei: Initialize the variable Map
Posted by Zhang, Shenglei 6 years, 3 months ago
Map is used but not Initialized.
Map is called by IoMmuMap, in which Mapping(Map) is called by IoMmu->Map.
We can not assume Map is given an initial value at any step.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
index 7c6a6a5f9716..995ccd2463d2 100644
--- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
+++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
@@ -534,6 +534,8 @@ EhcCreateUrb (
   PEI_URB                       *Urb;
   VOID                          *Map;
 
+  Map = NULL;
+
   Urb = Ehc->Urb;
   Urb->Signature  = EHC_URB_SIG;
   InitializeListHead (&Urb->UrbList);
-- 
2.18.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49662): https://edk2.groups.io/g/devel/message/49662
Mute This Topic: https://groups.io/mt/39796126/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 1/3] MdeModulePkg/EhciPei: Initialize the variable Map
Posted by Wu, Hao A 6 years, 3 months ago
> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Wednesday, October 30, 2019 10:08 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A; Ni, Ray
> Subject: [PATCH v2 1/3] MdeModulePkg/EhciPei: Initialize the variable Map
> 
> Map is used but not Initialized.
> Map is called by IoMmuMap, in which Mapping(Map) is called by IoMmu-
> >Map.
> We can not assume Map is given an initial value at any step.


Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> 
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
> b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
> index 7c6a6a5f9716..995ccd2463d2 100644
> --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
> +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
> @@ -534,6 +534,8 @@ EhcCreateUrb (
>    PEI_URB                       *Urb;
>    VOID                          *Map;
> 
> +  Map = NULL;
> +
>    Urb = Ehc->Urb;
>    Urb->Signature  = EHC_URB_SIG;
>    InitializeListHead (&Urb->UrbList);
> --
> 2.18.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49707): https://edk2.groups.io/g/devel/message/49707
Mute This Topic: https://groups.io/mt/39796126/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-