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>
This commit is contained in:
parent
8ce6cebc2f
commit
9e4b816bc3
1 changed files with 6 additions and 7 deletions
|
@ -920,17 +920,17 @@ wait_connect:
|
||||||
timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
|
timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
|
||||||
|
|
||||||
release_sock(sk);
|
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,
|
sk->sk_state != CAIF_CONNECTING,
|
||||||
timeo);
|
timeo);
|
||||||
lock_sock(sk);
|
lock_sock(sk);
|
||||||
if (err < 0)
|
if (timeo < 0)
|
||||||
goto out; /* -ERESTARTSYS */
|
goto out; /* -ERESTARTSYS */
|
||||||
if (err == 0 && sk->sk_state != CAIF_CONNECTED) {
|
|
||||||
err = -ETIMEDOUT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
err = -ETIMEDOUT;
|
||||||
|
if (timeo == 0 && sk->sk_state != CAIF_CONNECTED)
|
||||||
|
goto out;
|
||||||
if (sk->sk_state != CAIF_CONNECTED) {
|
if (sk->sk_state != CAIF_CONNECTED) {
|
||||||
sock->state = SS_UNCONNECTED;
|
sock->state = SS_UNCONNECTED;
|
||||||
err = sock_error(sk);
|
err = sock_error(sk);
|
||||||
|
@ -945,7 +945,6 @@ out:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* caif_release() - Disconnect a CAIF Socket
|
* caif_release() - Disconnect a CAIF Socket
|
||||||
* Copied and modified af_irda.c:irda_release().
|
* Copied and modified af_irda.c:irda_release().
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue