qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] colo-compare: fix the dangerous assignment


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] colo-compare: fix the dangerous assignment
Date: Thu, 16 Nov 2017 21:07:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Am 16.11.2017 um 03:28 schrieb Mao Zhongyi:
> Cc: Peter Maydell <address@hidden>
> Cc: Jason Wang <address@hidden>
> Cc: Zhang Chen <address@hidden>
> Cc: Li Zhijian <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Fixes: 8ec14402029d783720f4312ed8a925548e1dad61
> Reported-by: Peter Maydell <address@hidden>
> Reported-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Mao Zhongyi <address@hidden>
> ---
>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]