Commit 9e4b816b authored by Sjur Braendeland's avatar Sjur Braendeland Committed by David S. Miller

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: default avatarSjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ce6cebc
......@@ -920,17 +920,17 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
release_sock(sk);
err = wait_event_interruptible_timeout(*sk_sleep(sk),
err = -ERESTARTSYS;
timeo = wait_event_interruptible_timeout(*sk_sleep(sk),
sk->sk_state != CAIF_CONNECTING,
timeo);
lock_sock(sk);
if (err < 0)
if (timeo < 0)
goto out; /* -ERESTARTSYS */
if (err == 0 && sk->sk_state != CAIF_CONNECTED) {
err = -ETIMEDOUT;
if (timeo == 0 && sk->sk_state != CAIF_CONNECTED)
goto out;
}
if (sk->sk_state != CAIF_CONNECTED) {
sock->state = SS_UNCONNECTED;
err = sock_error(sk);
......@@ -945,7 +945,6 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
return err;
}
/*
* caif_release() - Disconnect a CAIF Socket
* Copied and modified af_irda.c:irda_release().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment