From: Dexuan Cui Date: Sat, 15 Jun 2019 05:00:57 +0000 (+0000) Subject: hv_sock: Suppress bogus "may be used uninitialized" warnings X-Git-Tag: v5.15~6158^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d424a2afd7da136a98e9485bfd6c5d5506bd77f8;p=platform%2Fkernel%2Flinux-starfive.git hv_sock: Suppress bogus "may be used uninitialized" warnings gcc 8.2.0 may report these bogus warnings under some condition: warning: ‘vnew’ may be used uninitialized in this function warning: ‘hvs_new’ may be used uninitialized in this function Actually, the 2 pointers are only initialized and used if the variable "conn_from_host" is true. The code is not buggy here. Signed-off-by: Dexuan Cui Signed-off-by: David S. Miller --- diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c index 982a8dc..e4801c7 100644 --- a/net/vmw_vsock/hyperv_transport.c +++ b/net/vmw_vsock/hyperv_transport.c @@ -344,8 +344,8 @@ static void hvs_open_connection(struct vmbus_channel *chan) struct sockaddr_vm addr; struct sock *sk, *new = NULL; - struct vsock_sock *vnew; - struct hvsock *hvs, *hvs_new; + struct vsock_sock *vnew = NULL; + struct hvsock *hvs, *hvs_new = NULL; int ret; if_type = &chan->offermsg.offer.if_type;