public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rfcomm/sock.c: rfcomm_sock_sendmsg() does not return error on a connection faulure
@ 2008-12-18 14:48 Victor Shcherbatyuk
  2008-12-19  7:00 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Victor Shcherbatyuk @ 2008-12-18 14:48 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

Hi,

We noticed a problem, when a connection from the remote device is
dropper the write() function does not return the error in the user
space, returning 0 instead - indicating that 0 bytes are sent. We've
also noticed that with some older kernels it used to work (2.6.13 vs
2.6.23-17). The patch fixes the problem.

Regards,
    Victor.

[-- Attachment #2: sock.c.patch --]
[-- Type: application/octet-stream, Size: 461 bytes --]

--- a/net/bluetooth/rfcomm/sock.c	2008-12-18 15:20:15.000000000 +0100
+++ b/net/bluetooth/rfcomm/sock.c	2008-12-18 15:18:00.000000000 +0100
@@ -575,8 +575,11 @@
 
 		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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-19 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 14:48 [PATCH] rfcomm/sock.c: rfcomm_sock_sendmsg() does not return error on a connection faulure Victor Shcherbatyuk
2008-12-19  7:00 ` Marcel Holtmann
2008-12-19 13:04   ` Victor Shcherbatyuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox