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

[Xen-devel] [PATCH for-4.7 3/6] rombios/tcgbios: initialise logdataptr in HashLogEvent32

Gcc complains:

tcgbios.c: In function ‘HashLogEvent32’:
tcgbios.c:1131:10: error: ‘logdataptr’ may be used uninitialized in this 
function [-Werror=maybe-uninitialized]
    entry = tcpa_extend_acpi_log(logdataptr);

It fails to figure out when logdataptr is used it is always initialised
in a if block a few line above.

Signed-off-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 
index 3501051..fa22c44 100644
--- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
@@ -1062,7 +1062,7 @@ uint32_t HashLogEvent32(struct hlei *hlei, struct hleo 
        uint32_t rc = 0;
        uint16_t size;
-       uint32_t logdataptr;
+       uint32_t logdataptr = 0;
        uint32_t logdatalen;
        uint32_t hashdataptr;
        uint32_t hashdatalen;

Xen-devel mailing list



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