public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V2 0/2] MdeModulePkg/Variable: Initialize local variables
@ 2019-11-21 23:02 Kubacki, Michael A
  2019-11-21 23:02 ` [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable" Kubacki, Michael A
  2019-11-21 23:02 ` [PATCH V2 2/2] MdeModulePkg/Variable: Initialize local variable "RtPtrTrack" Kubacki, Michael A
  0 siblings, 2 replies; 5+ messages in thread
From: Kubacki, Michael A @ 2019-11-21 23:02 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Michael D Kinney, Jian J Wang, Hao A Wu

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2364

Fixes a new build warning in VS2012 introduced in f8ff4cca7c.

As requested, a single patch (https://edk2.groups.io/g/devel/message/50990)
that initialized both variables has been split into two separate
patches. The Reviewed-by messages for that patch have been carried
to these two patches. The file changes are the same.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>

Michael Kubacki (2):
  MdeModulePkg/Variable: Initialize local variable "Variable"
  MdeModulePkg/Variable: Initialize local variable "RtPtrTrack"

 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c       | 2 ++
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 2 ++
 2 files changed, 4 insertions(+)

-- 
2.16.2.windows.1


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

* [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable"
  2019-11-21 23:02 [PATCH V2 0/2] MdeModulePkg/Variable: Initialize local variables Kubacki, Michael A
@ 2019-11-21 23:02 ` Kubacki, Michael A
  2019-11-25 14:36   ` Liming Gao
  2019-11-21 23:02 ` [PATCH V2 2/2] MdeModulePkg/Variable: Initialize local variable "RtPtrTrack" Kubacki, Michael A
  1 sibling, 1 reply; 5+ messages in thread
From: Kubacki, Michael A @ 2019-11-21 23:02 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Michael D Kinney, Jian J Wang, Hao A Wu

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2364

Fixes a new build warning in VS2012 introduced in f8ff4cca7c.

This patch initializes the local variable "Variable" in
VariableServiceGetNextVariableInternal ().

This ensures the pointers in the structure are initialized
in the case no variable stores exist in the list of variable
stores.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
index d458f1c608..f6d187543d 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
@@ -551,6 +551,8 @@ VariableServiceGetNextVariableInternal (
     return EFI_INVALID_PARAMETER;
   }
 
+  ZeroMem (&Variable, sizeof (Variable));
+
   // Check if the variable exists in the given variable store list
   for (StoreType = (VARIABLE_STORE_TYPE) 0; StoreType < VariableStoreTypeMax; StoreType++) {
     if (VariableStoreList[StoreType] == NULL) {
-- 
2.16.2.windows.1


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

* [PATCH V2 2/2] MdeModulePkg/Variable: Initialize local variable "RtPtrTrack"
  2019-11-21 23:02 [PATCH V2 0/2] MdeModulePkg/Variable: Initialize local variables Kubacki, Michael A
  2019-11-21 23:02 ` [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable" Kubacki, Michael A
@ 2019-11-21 23:02 ` Kubacki, Michael A
  2019-11-22 11:24   ` [edk2-devel] " Philippe Mathieu-Daudé
  1 sibling, 1 reply; 5+ messages in thread
From: Kubacki, Michael A @ 2019-11-21 23:02 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Michael D Kinney, Jian J Wang, Hao A Wu

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2364

Fixes a new build warning in VS2012 introduced in f8ff4cca7c.

This patch initializes the local variable "RtPtrTrack" in
FindVariableInRuntimeCache ().

This ensures the pointers in the structure are initialized
in the case no variable stores exist in the list of variable
stores.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
index d525998ae3..2cf0ed32ae 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
@@ -590,6 +590,8 @@ FindVariableInRuntimeCache (
     return EFI_INVALID_PARAMETER;
   }
 
+  ZeroMem (&RtPtrTrack, sizeof (RtPtrTrack));
+
   //
   // The UEFI specification restricts Runtime Services callers from invoking the same or certain other Runtime Service
   // functions prior to completion and return from a previous Runtime Service call. These restrictions prevent
-- 
2.16.2.windows.1


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

* Re: [edk2-devel] [PATCH V2 2/2] MdeModulePkg/Variable: Initialize local variable "RtPtrTrack"
  2019-11-21 23:02 ` [PATCH V2 2/2] MdeModulePkg/Variable: Initialize local variable "RtPtrTrack" Kubacki, Michael A
@ 2019-11-22 11:24   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-11-22 11:24 UTC (permalink / raw)
  To: devel, michael.a.kubacki
  Cc: Liming Gao, Michael D Kinney, Jian J Wang, Hao A Wu

On 11/22/19 12:02 AM, Kubacki, Michael A wrote:
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2364
> 
> Fixes a new build warning in VS2012 introduced in f8ff4cca7c.
> 
> This patch initializes the local variable "RtPtrTrack" in
> FindVariableInRuntimeCache ().
> 
> This ensures the pointers in the structure are initialized
> in the case no variable stores exist in the list of variable
> stores.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
> Reviewed-by: Liming Gao <liming.gao@intel.com>
> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
> index d525998ae3..2cf0ed32ae 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
> @@ -590,6 +590,8 @@ FindVariableInRuntimeCache (
>       return EFI_INVALID_PARAMETER;
>     }
>   
> +  ZeroMem (&RtPtrTrack, sizeof (RtPtrTrack));
> +
>     //
>     // The UEFI specification restricts Runtime Services callers from invoking the same or certain other Runtime Service
>     // functions prior to completion and return from a previous Runtime Service call. These restrictions prevent
> 

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>


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

* Re: [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable"
  2019-11-21 23:02 ` [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable" Kubacki, Michael A
@ 2019-11-25 14:36   ` Liming Gao
  0 siblings, 0 replies; 5+ messages in thread
From: Liming Gao @ 2019-11-25 14:36 UTC (permalink / raw)
  To: Kubacki, Michael A, devel@edk2.groups.io
  Cc: Kinney, Michael D, Wang, Jian J, Wu, Hao A

Create PR https://github.com/tianocore/edk2/pull/197, and 
push @290a485d6043a049b611aab30f450c74b8591f35..bd85bf54c268204c7a698a96f3ccd96cd77952cd

Thanks
Liming
> -----Original Message-----
> From: Kubacki, Michael A <michael.a.kubacki@intel.com>
> Sent: Friday, November 22, 2019 7:03 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Wu,
> Hao A <hao.a.wu@intel.com>
> Subject: [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable"
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2364
> 
> Fixes a new build warning in VS2012 introduced in f8ff4cca7c.
> 
> This patch initializes the local variable "Variable" in
> VariableServiceGetNextVariableInternal ().
> 
> This ensures the pointers in the structure are initialized
> in the case no variable stores exist in the list of variable
> stores.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
> Reviewed-by: Liming Gao <liming.gao@intel.com>
> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
> index d458f1c608..f6d187543d 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
> @@ -551,6 +551,8 @@ VariableServiceGetNextVariableInternal (
>      return EFI_INVALID_PARAMETER;
>    }
> 
> +  ZeroMem (&Variable, sizeof (Variable));
> +
>    // Check if the variable exists in the given variable store list
>    for (StoreType = (VARIABLE_STORE_TYPE) 0; StoreType < VariableStoreTypeMax; StoreType++) {
>      if (VariableStoreList[StoreType] == NULL) {
> --
> 2.16.2.windows.1


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

end of thread, other threads:[~2019-11-25 14:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-21 23:02 [PATCH V2 0/2] MdeModulePkg/Variable: Initialize local variables Kubacki, Michael A
2019-11-21 23:02 ` [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable" Kubacki, Michael A
2019-11-25 14:36   ` Liming Gao
2019-11-21 23:02 ` [PATCH V2 2/2] MdeModulePkg/Variable: Initialize local variable "RtPtrTrack" Kubacki, Michael A
2019-11-22 11:24   ` [edk2-devel] " Philippe Mathieu-Daudé

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