diff options
Diffstat (limited to 'net/caif/caif_socket.c')
-rw-r--r-- | net/caif/caif_socket.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index c3a70c5c893a..77e99568acda 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
@@ -920,17 +920,17 @@ wait_connect: | |||
920 | timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); | 920 | timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); |
921 | 921 | ||
922 | release_sock(sk); | 922 | release_sock(sk); |
923 | err = wait_event_interruptible_timeout(*sk_sleep(sk), | 923 | err = -ERESTARTSYS; |
924 | timeo = wait_event_interruptible_timeout(*sk_sleep(sk), | ||
924 | sk->sk_state != CAIF_CONNECTING, | 925 | sk->sk_state != CAIF_CONNECTING, |
925 | timeo); | 926 | timeo); |
926 | lock_sock(sk); | 927 | lock_sock(sk); |
927 | if (err < 0) | 928 | if (timeo < 0) |
928 | goto out; /* -ERESTARTSYS */ | 929 | goto out; /* -ERESTARTSYS */ |
929 | if (err == 0 && sk->sk_state != CAIF_CONNECTED) { | ||
930 | err = -ETIMEDOUT; | ||
931 | goto out; | ||
932 | } | ||
933 | 930 | ||
931 | err = -ETIMEDOUT; | ||
932 | if (timeo == 0 && sk->sk_state != CAIF_CONNECTED) | ||
933 | goto out; | ||
934 | if (sk->sk_state != CAIF_CONNECTED) { | 934 | if (sk->sk_state != CAIF_CONNECTED) { |
935 | sock->state = SS_UNCONNECTED; | 935 | sock->state = SS_UNCONNECTED; |
936 | err = sock_error(sk); | 936 | err = sock_error(sk); |
@@ -945,7 +945,6 @@ out: | |||
945 | return err; | 945 | return err; |
946 | } | 946 | } |
947 | 947 | ||
948 | |||
949 | /* | 948 | /* |
950 | * caif_release() - Disconnect a CAIF Socket | 949 | * caif_release() - Disconnect a CAIF Socket |
951 | * Copied and modified af_irda.c:irda_release(). | 950 | * Copied and modified af_irda.c:irda_release(). |