aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/rfcomm/sock.c
diff options
context:
space:
mode:
authorVictor Shcherbatyuk <victor.shcherbatyuk@tomtom.com>2009-01-15 15:52:12 -0500
committerMarcel Holtmann <marcel@holtmann.org>2009-02-27 00:14:21 -0500
commit91aa35a5aa3540223066bf6b51c935418c63a35d (patch)
treeff9e15db0b2e029a7704e4ba8b1f138b6805dbef /net/bluetooth/rfcomm/sock.c
parentf11c179eea77b8afc2fb7cb4b9a8815b85e3c16f (diff)
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: Victor Shcherbatyuk <victor.shcherbatyuk@tomtom.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/rfcomm/sock.c')
-rw-r--r--net/bluetooth/rfcomm/sock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index d3fc6fca38d0..ce505f2a755b 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -570,8 +570,11 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
570 570
571 skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE, 571 skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE,
572 msg->msg_flags & MSG_DONTWAIT, &err); 572 msg->msg_flags & MSG_DONTWAIT, &err);
573 if (!skb) 573 if (!skb) {
574 if (sent == 0)
575 sent = err;
574 break; 576 break;
577 }
575 skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE); 578 skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE);
576 579
577 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); 580 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);