]> git.proxmox.com Git - mirror_qemu.git/commitdiff
aspeed/i2c: Prevent uninitialized warning
authorMiroslav Rezanina <mrezanin@redhat.com>
Tue, 21 Jan 2020 09:28:14 +0000 (10:28 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 6 Feb 2020 10:13:24 +0000 (11:13 +0100)
Compiler reports uninitialized warning for cmd_flags variable.

Adding NULL initialization to prevent this warning.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <07957dcab31f65de3dd30efa91e6b9152ac79879.1579598240.git.mrezanin@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/i2c/aspeed_i2c.c

index 9cda9685016cc261da5f73f5b695d55af5f8b562..fb973a983dcd78dcd296665c9ca7311b98fa4a2e 100644 (file)
@@ -400,7 +400,7 @@ static bool aspeed_i2c_check_sram(AspeedI2CBus *bus)
 
 static void aspeed_i2c_bus_cmd_dump(AspeedI2CBus *bus)
 {
-    g_autofree char *cmd_flags;
+    g_autofree char *cmd_flags = NULL;
     uint32_t count;
 
     if (bus->cmd & (I2CD_RX_BUFF_ENABLE | I2CD_RX_BUFF_ENABLE)) {