提交 9e4b816b 编写于 作者: S Sjur Braendeland 提交者: 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: NSjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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;
goto out;
}
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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册