diff mbox

[edk2] OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning

Message ID 20170608190516.7828-1-ard.biesheuvel@linaro.org
State Accepted
Commit 8f98c76f992be0d22cafaf302ee95350cef3f0c7
Headers show

Commit Message

Ard Biesheuvel June 8, 2017, 7:05 p.m. UTC
Commit 4275f38507a4 ("OvmfPkg/AcpiPlatformDxe: alloc blobs from 64-bit
space unless restricted") introduced a variable which is [incorrectly]
identified by GCC as being potentially uninitialized. So let's just set
it to NULL before use.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.9.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Laszlo Ersek June 8, 2017, 10:18 p.m. UTC | #1
On 06/08/17 21:05, Ard Biesheuvel wrote:
> Commit 4275f38507a4 ("OvmfPkg/AcpiPlatformDxe: alloc blobs from 64-bit

> space unless restricted") introduced a variable which is [incorrectly]

> identified by GCC as being potentially uninitialized. So let's just set

> it to NULL before use.

> 

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c

> index 98be36c64b43..a0b1cfd2be05 100644

> --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c

> +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c

> @@ -1001,6 +1001,7 @@ InstallQemuFwCfgTables (

>    RestorePciDecoding (OriginalPciAttributes, OriginalPciAttributesCount);

>    LoaderEnd = LoaderStart + FwCfgSize / sizeof *LoaderEntry;

>  

> +  AllocationsRestrictedTo32Bit = NULL;

>    Status = CollectAllocationsRestrictedTo32Bit (

>               &AllocationsRestrictedTo32Bit,

>               LoaderStart,

> 


Reviewed-by: Laszlo Ersek <lersek@redhat.com>


Thanks, Ard!
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel June 9, 2017, 8:58 a.m. UTC | #2
On 8 June 2017 at 22:18, Laszlo Ersek <lersek@redhat.com> wrote:
> On 06/08/17 21:05, Ard Biesheuvel wrote:

>> Commit 4275f38507a4 ("OvmfPkg/AcpiPlatformDxe: alloc blobs from 64-bit

>> space unless restricted") introduced a variable which is [incorrectly]

>> identified by GCC as being potentially uninitialized. So let's just set

>> it to NULL before use.

>>

>> Contributed-under: TianoCore Contribution Agreement 1.0

>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>> ---

>>  OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 1 +

>>  1 file changed, 1 insertion(+)

>>

>> diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c

>> index 98be36c64b43..a0b1cfd2be05 100644

>> --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c

>> +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c

>> @@ -1001,6 +1001,7 @@ InstallQemuFwCfgTables (

>>    RestorePciDecoding (OriginalPciAttributes, OriginalPciAttributesCount);

>>    LoaderEnd = LoaderStart + FwCfgSize / sizeof *LoaderEntry;

>>

>> +  AllocationsRestrictedTo32Bit = NULL;

>>    Status = CollectAllocationsRestrictedTo32Bit (

>>               &AllocationsRestrictedTo32Bit,

>>               LoaderStart,

>>

>

> Reviewed-by: Laszlo Ersek <lersek@redhat.com>

>


Pushed as 8f98c76f992b
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
index 98be36c64b43..a0b1cfd2be05 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
@@ -1001,6 +1001,7 @@  InstallQemuFwCfgTables (
   RestorePciDecoding (OriginalPciAttributes, OriginalPciAttributesCount);
   LoaderEnd = LoaderStart + FwCfgSize / sizeof *LoaderEntry;
 
+  AllocationsRestrictedTo32Bit = NULL;
   Status = CollectAllocationsRestrictedTo32Bit (
              &AllocationsRestrictedTo32Bit,
              LoaderStart,