From: Miroslav Rezanina Date: Tue, 21 Jan 2020 09:28:14 +0000 (+0100) Subject: aspeed/i2c: Prevent uninitialized warning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f821bac4af692e88137722bbf8e601337b9e1722;p=qemu.git aspeed/i2c: Prevent uninitialized warning Compiler reports uninitialized warning for cmd_flags variable. Adding NULL initialization to prevent this warning. Signed-off-by: Miroslav Rezanina Reviewed-by: Thomas Huth Message-Id: <07957dcab31f65de3dd30efa91e6b9152ac79879.1579598240.git.mrezanin@redhat.com> Signed-off-by: Laurent Vivier --- diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index 9cda968501..fb973a983d 100644 --- a/hw/i2c/aspeed_i2c.c +++ b/hw/i2c/aspeed_i2c.c @@ -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)) {