• Subject: [edk2] [PATCH] OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning
  • Author: Ard Biesheuvel
  • Date: June 8, 2017, 7:05 p.m.
  • Patches: 1 / 1
Changeset
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 1 +
1 file changed, 1 insertion(+)
Git apply log
Switched to a new branch '20170608190516.7828-1-ard.biesheuvel@linaro.org'
Applying: OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning
Using index info to reconstruct a base tree...
error: patch failed: OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c:1001
error: OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c: patch does not apply
Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Cannot fall back to three-way merge.
Patch failed at 0001 OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning
The copy of the patch that failed is found in:
   /var/tmp/tmpnc_ntzp6/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Failed to apply patch:
[edk2] [PATCH] OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning
[edk2] [PATCH] OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning
Posted by Ard Biesheuvel, 6 weeks ago
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,
-- 
2.9.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning
Posted by Laszlo Ersek, 6 weeks ago
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
Re: [edk2] [PATCH] OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning
Posted by Ard Biesheuvel, 5 weeks ago
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