Skip to content

Commit

Permalink
hv_sock: Suppress bogus "may be used uninitialized" warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dcui authored and davem330 committed Jun 16, 2019
1 parent 718f4a2 commit d424a2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/vmw_vsock/hyperv_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d424a2a

Please sign in to comment.