[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] rombios/tcgbios: initialise size in tcpa_extend_acpi_log



commit bdb2a5610442d7adc5000c5ea4ab01b2bd7222d1
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Fri Apr 29 16:11:12 2016 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Fri May 6 15:50:06 2016 +0100

    rombios/tcgbios: initialise size in tcpa_extend_acpi_log
    
    Gcc complains:
    
    tcgbios.c:362:3: error: â??sizeâ?? may be used uninitialized in this 
function [-Werror=maybe-uninitialized]
       memcpy((char *)lasa_last, (char *)entry_ptr, size);
    
    It fails to figure out if size is used in memcpy it is always initialised.
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Reviewed-by: Doug Goldstein <cardoe@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/firmware/rombios/32bit/tcgbios/tcgbios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c 
b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
index beef5a4..d1d1203 100644
--- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
@@ -330,7 +330,7 @@ uint32_t tcpa_extend_acpi_log(uint32_t entry_ptr)
        uint32_t res = 0;
        unsigned char *lasa_last = tcpa_get_lasa_last_ptr();
        unsigned char *lasa_base = tcpa_get_lasa_base_ptr();
-       uint32_t size;
+       uint32_t size = 0;
        uint16_t entry_count = tcpa_acpi.entry_count;
        struct pcpes *pcpes = (struct pcpes *)entry_ptr;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.