public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/3] MdeModulePkg: Initialize variables
@ 2019-10-16  1:46 Zhang, Shenglei
  2019-10-16  1:46 ` [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map Zhang, Shenglei
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Zhang, Shenglei @ 2019-10-16  1:46 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni, Dandan Bi, Liming Gao

Initialize the variables before used.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Shenglei Zhang (3):
  MdeModulePkg/EhciPei: Initialize the variable Map
  MdeModulePkg/UhciPei: Initialize the variable RequestMap
  MdeModulePkg/Mem: Initialize the variable MapMemory

 MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 2 ++
 MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 2 ++
 MdeModulePkg/Core/Dxe/Mem/HeapGuard.c  | 2 ++
 3 files changed, 6 insertions(+)

-- 
2.18.0.windows.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map
  2019-10-16  1:46 [PATCH 0/3] MdeModulePkg: Initialize variables Zhang, Shenglei
@ 2019-10-16  1:46 ` Zhang, Shenglei
  2019-10-30  6:46   ` Wu, Hao A
  2019-10-16  1:46 ` [PATCH 2/3] MdeModulePkg/UhciPei: Initialize the variable RequestMap Zhang, Shenglei
  2019-10-16  1:46 ` [PATCH 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory Zhang, Shenglei
  2 siblings, 1 reply; 6+ messages in thread
From: Zhang, Shenglei @ 2019-10-16  1:46 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni

Map is used but not Initialized.

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] MdeModulePkg/UhciPei: Initialize the variable RequestMap
  2019-10-16  1:46 [PATCH 0/3] MdeModulePkg: Initialize variables Zhang, Shenglei
  2019-10-16  1:46 ` [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map Zhang, Shenglei
@ 2019-10-16  1:46 ` Zhang, Shenglei
  2019-10-30  6:46   ` Wu, Hao A
  2019-10-16  1:46 ` [PATCH 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory Zhang, Shenglei
  2 siblings, 1 reply; 6+ messages in thread
From: Zhang, Shenglei @ 2019-10-16  1:46 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni

RequestMap is used but not Initialized.

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/UhciPei/UhcPeim.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
index b897c3f82ce6..a05834da3c4a 100644
--- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
+++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
@@ -274,6 +274,8 @@ UhcControlTransfer (
 
   PktID       = INPUT_PACKET_ID;
 
+  RequestMap  = NULL;
+
   if (Request == NULL || TransferResult == NULL) {
     return EFI_INVALID_PARAMETER;
   }
-- 
2.18.0.windows.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory
  2019-10-16  1:46 [PATCH 0/3] MdeModulePkg: Initialize variables Zhang, Shenglei
  2019-10-16  1:46 ` [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map Zhang, Shenglei
  2019-10-16  1:46 ` [PATCH 2/3] MdeModulePkg/UhciPei: Initialize the variable RequestMap Zhang, Shenglei
@ 2019-10-16  1:46 ` Zhang, Shenglei
  2 siblings, 0 replies; 6+ messages in thread
From: Zhang, Shenglei @ 2019-10-16  1:46 UTC (permalink / raw)
  To: devel; +Cc: Dandan Bi, Liming Gao

Initialize MapMemory to 0 in HeapGuard.c.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
index 9477b94044ba..b4cb48843fb7 100644
--- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
+++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
@@ -225,6 +225,8 @@ FindGuardedMemoryMap (
   UINTN                   BitsToUnitEnd;
   EFI_STATUS              Status;
 
+  MapMemory = 0;
+
   //
   // Adjust current map table depth according to the address to access
   //
-- 
2.18.0.windows.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map
  2019-10-16  1:46 ` [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map Zhang, Shenglei
@ 2019-10-30  6:46   ` Wu, Hao A
  0 siblings, 0 replies; 6+ messages in thread
From: Wu, Hao A @ 2019-10-30  6:46 UTC (permalink / raw)
  To: Zhang, Shenglei, devel@edk2.groups.io; +Cc: Ni, Ray

> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Wednesday, October 16, 2019 9:47 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A; Ni, Ray
> Subject: [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map
> 
> Map is used but not Initialized.
> 
> 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;
> +


Hello,

Is this a real issue or just a false positive report by some compiler or static
analyzer?

If is a real issue, could you help to describe the issue in more detail? If it
is a false positive report, could you help to add some comments together with
the change? Thanks in advance.

Best Regards,
Hao Wu


>    Urb = Ehc->Urb;
>    Urb->Signature  = EHC_URB_SIG;
>    InitializeListHead (&Urb->UrbList);
> --
> 2.18.0.windows.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] MdeModulePkg/UhciPei: Initialize the variable RequestMap
  2019-10-16  1:46 ` [PATCH 2/3] MdeModulePkg/UhciPei: Initialize the variable RequestMap Zhang, Shenglei
@ 2019-10-30  6:46   ` Wu, Hao A
  0 siblings, 0 replies; 6+ messages in thread
From: Wu, Hao A @ 2019-10-30  6:46 UTC (permalink / raw)
  To: Zhang, Shenglei, devel@edk2.groups.io; +Cc: Ni, Ray

> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Wednesday, October 16, 2019 9:47 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A; Ni, Ray
> Subject: [PATCH 2/3] MdeModulePkg/UhciPei: Initialize the variable
> RequestMap
> 
> RequestMap is used but not Initialized.
> 
> 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/UhciPei/UhcPeim.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
> b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
> index b897c3f82ce6..a05834da3c4a 100644
> --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
> +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
> @@ -274,6 +274,8 @@ UhcControlTransfer (
> 
>    PktID       = INPUT_PACKET_ID;
> 
> +  RequestMap  = NULL;


Hello,

Is this a real issue or just a false positive report by some compiler or static
analyzer?

If is a real issue, could you help to describe the issue in more detail? If it
is a false positive report, could you help to add some comments together with
the change? Thanks in advance.

Best Regards,
Hao Wu


> +
>    if (Request == NULL || TransferResult == NULL) {
>      return EFI_INVALID_PARAMETER;
>    }
> --
> 2.18.0.windows.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-30  6:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-16  1:46 [PATCH 0/3] MdeModulePkg: Initialize variables Zhang, Shenglei
2019-10-16  1:46 ` [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map Zhang, Shenglei
2019-10-30  6:46   ` Wu, Hao A
2019-10-16  1:46 ` [PATCH 2/3] MdeModulePkg/UhciPei: Initialize the variable RequestMap Zhang, Shenglei
2019-10-30  6:46   ` Wu, Hao A
2019-10-16  1:46 ` [PATCH 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory Zhang, Shenglei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox