qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kuhn.chenqun@huawei.com, qemu-devel@nongnu.org, clg@kaod.org,
	peter.maydell@linaro.org
Cc: qemu-trivial@nongnu.org, andrew@aj.id.au,
	Miroslav Rezanina <mrezanin@redhat.com>,
	zhang.zhanghailiang@huawei.com, joel@jms.id.au
Subject: Re: [PATCH] aspeed/i2c:fix uninitialized variable warning
Date: Thu, 6 Feb 2020 09:21:40 +0100	[thread overview]
Message-ID: <3b091938-34a4-0a75-3a86-93195a2382e2@redhat.com> (raw)
In-Reply-To: <20200206040753.42252-1-kuhn.chenqun@huawei.com>

On 06/02/2020 05.07, kuhn.chenqun@huawei.com wrote:
> From: Chen Qun <kuhn.chenqun@huawei.com>
> 
> Fix warning:
> hw/i2c/aspeed_i2c.c: In function ‘aspeed_i2c_bus_write’:
> glib/glib-autocleanups.h:28:3: warning: ‘cmd_flags’ may be
> used uninitialized in this function [-Wmaybe-uninitialized]
>    g_free (*pp);
>    ^~~~~~~~~~~~
> hw/i2c/aspeed_i2c.c:403:22: note: ‘cmd_flags’ was declared here
>      g_autofree char *cmd_flags;
>                       ^~~~~~~~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
>  hw/i2c/aspeed_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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)) {
> 

Thanks. Looks like the same patch that has been reported already here:

https://lists.gnu.org/archive/html/qemu-devel/2020-01/msg04492.html

Could someone please pick this up (e.g. qemu-trivial?)?

 Thomas



  reply	other threads:[~2020-02-06  8:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06  4:07 [PATCH] aspeed/i2c:fix uninitialized variable warning kuhn.chenqun
2020-02-06  8:21 ` Thomas Huth [this message]
2020-02-06  9:35   ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b091938-34a4-0a75-3a86-93195a2382e2@redhat.com \
    --to=thuth@redhat.com \
    --cc=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=joel@jms.id.au \
    --cc=kuhn.chenqun@huawei.com \
    --cc=mrezanin@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).