Commit 91aa35a5 authored by Victor Shcherbatyuk's avatar Victor Shcherbatyuk Committed by Marcel Holtmann

Bluetooth: Fix issue with return value of rfcomm_sock_sendmsg()

In case of connection failures the rfcomm_sock_sendmsg() should return
an error and not a 0 value.
Signed-off-by: default avatarVictor Shcherbatyuk <victor.shcherbatyuk@tomtom.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent f11c179e
...@@ -570,8 +570,11 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -570,8 +570,11 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE, skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE,
msg->msg_flags & MSG_DONTWAIT, &err); msg->msg_flags & MSG_DONTWAIT, &err);
if (!skb) if (!skb) {
if (sent == 0)
sent = err;
break; break;
}
skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE); skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE);
err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
......
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