qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Jason Wang <jasowang@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Li Zhijian <lizhijian@cn.fujitsu.com>,
	Zhang Chen <zhangckid@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] colo-compare: fix the dangerous assignment
Date: Thu, 16 Nov 2017 21:07:38 +0100	[thread overview]
Message-ID: <b6ef2227-c462-ccec-9e37-d29a0cdace59@weilnetz.de> (raw)
In-Reply-To: <20171116022832.24894-1-maozy.fnst@cn.fujitsu.com>

Am 16.11.2017 um 03:28 schrieb Mao Zhongyi:
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Zhang Chen <zhangckid@gmail.com>
> Cc: Li Zhijian <lizhijian@cn.fujitsu.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Fixes: 8ec14402029d783720f4312ed8a925548e1dad61
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
> ---
>  net/colo-compare.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/colo-compare.c b/net/colo-compare.c
> index ccdcba2..1ce195f 100644
> --- a/net/colo-compare.c
> +++ b/net/colo-compare.c
> @@ -179,7 +179,7 @@ static int packet_enqueue(CompareState *s, int mode, Connection **con)
>                           "drop packet");
>          }
>      }
> -    con = &conn;
> +    *con = conn;
>  
>      return 0;
>  }

The patch is definitely needed if the new function parameter con
should work.

It also fixes a gcc compiler warning:
net/colo-compare.c:139:67: warning: parameter ‘con’ set but not used
[-Wunused-but-set-parameter]

I‌ think using -Wextra would be really good to catch such bugs earlier.

Regards,
Stefan

  parent reply	other threads:[~2017-11-16 20:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16  2:28 [Qemu-devel] [PATCH] colo-compare: fix the dangerous assignment Mao Zhongyi
2017-11-16 10:13 ` Darren Kenny
2017-11-16 12:25   ` Mao Zhongyi
2017-11-16 20:07 ` Stefan Weil [this message]
2017-11-17  1:21   ` Mao Zhongyi
2017-11-17  2:34 ` Jason Wang

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=b6ef2227-c462-ccec-9e37-d29a0cdace59@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=jasowang@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=maozy.fnst@cn.fujitsu.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhangckid@gmail.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).