diff options
author | Sjur Braendeland <sjur.brandeland@stericsson.com> | 2010-05-20 22:16:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-24 02:57:41 -0400 |
commit | 9e4b816bc31962ebbb8784d602acd5fa25a08ad8 (patch) | |
tree | e4f15177ea142bacda24c6ed8495748e19cb033a /net | |
parent | 8ce6cebc2f126f3ecf2d80746ea54245adf18057 (diff) |
caif: Bugfix - wait_ev*_timeout returns long.
Discovered bug when testing on 64bit architecture.
Fixed by using long to store result from wait_event_interruptible_timeout.
Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-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(). |