Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <decui@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dexuan Cui and committed by
David S. Miller
d424a2af 718f4a25

+2 -2
+2 -2
net/vmw_vsock/hyperv_transport.c
··· 344 344 345 345 struct sockaddr_vm addr; 346 346 struct sock *sk, *new = NULL; 347 - struct vsock_sock *vnew; 348 - struct hvsock *hvs, *hvs_new; 347 + struct vsock_sock *vnew = NULL; 348 + struct hvsock *hvs, *hvs_new = NULL; 349 349 int ret; 350 350 351 351 if_type = &chan->offermsg.offer.if_type;