From e085c81d3fc95a7e2e938deec65843ba7c00afe3 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 13 Feb 2013 18:00:19 +0100 Subject: [PATCH 2/4] af_vsock: don't overwrite sock->state We set sock->state to SS_CONNECTING before calling the transport, no need to do that again afterwards, thereby overwriting any updates the transport's connect function might have done. Signed-off-by: Gerd Hoffmann --- net/vmw_vsock/af_vsock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 54bb7bd..e5d1467 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1184,11 +1184,11 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr, if (err < 0) goto out; - /* Mark sock as connecting and set the error code to in + /* When still connecting set the error code to in * progress in case this is a non-blocking connect. */ - sock->state = SS_CONNECTING; - err = -EINPROGRESS; + if (sock->state == SS_CONNECTING) + err = -EINPROGRESS; } /* The receive path will handle all communication until we are able to -- 1.7.9.7