Skip to content

Commit

Permalink
Bluetooth: Fix issue with return value of rfcomm_sock_sendmsg()
Browse files Browse the repository at this point in the history
In case of connection failures the rfcomm_sock_sendmsg() should return
an error and not a 0 value.

Signed-off-by: Victor Shcherbatyuk <victor.shcherbatyuk@tomtom.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Victor Shcherbatyuk authored and Marcel Holtmann committed Feb 27, 2009
1 parent f11c179 commit 91aa35a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/bluetooth/rfcomm/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
msg->msg_flags & MSG_DONTWAIT, &err);
if (!skb)
if (!skb) {
if (sent == 0)
sent = err;
break;
}
skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE);

err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
Expand Down

0 comments on commit 91aa35a

Please sign in to comment.