public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.4.19 Bluetooth [3/5] SCO fixes
@ 2002-08-04 10:57 Maksim (Max)  Krasnyanskiy
  0 siblings, 0 replies; only message in thread
From: Maksim (Max)  Krasnyanskiy @ 2002-08-04 10:57 UTC (permalink / raw)
  To: Marcelo Tosatti, Alan Cox; +Cc: linux-kernel, bluez-devel

SCO updates.

- Socket locking fixes

 sco.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

http://bluez.sourceforge.net/patches/patch-2.4.19-bluetooth-sco.gz

Please apply

Max

diff -urN -x 'hci*' -x 'l2cap*' -x 'af_*' linux.orig/net/bluetooth/sco.c linux/net/bluetooth/sco.c
--- linux.orig/net/bluetooth/sco.c	Sat Aug  3 11:59:47 2002
+++ linux/net/bluetooth/sco.c	Sat Aug  3 18:14:04 2002
@@ -25,9 +25,9 @@
 /*
  * BlueZ SCO sockets.
  *
- * $Id: sco.c,v 1.3 2002/04/17 17:37:16 maxk Exp $
+ * $Id: sco.c,v 1.4 2002/07/22 20:32:54 maxk Exp $
  */
-#define VERSION "0.2"
+#define VERSION "0.3"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -464,19 +464,17 @@
 		goto done;
 	}
 
-	write_lock(&sco_sk_list.lock);
+	write_lock_bh(&sco_sk_list.lock);
 
 	if (bacmp(src, BDADDR_ANY) && __sco_get_sock_by_addr(src)) {
 		err = -EADDRINUSE;
-		goto unlock;
+	} else {
+		/* Save source address */
+		bacpy(&bluez_pi(sk)->src, &sa->sco_bdaddr);
+		sk->state = BT_BOUND;
 	}
 
-	/* Save source address */
-	bacpy(&bluez_pi(sk)->src, &sa->sco_bdaddr);
-	sk->state = BT_BOUND;
-
-unlock:
-	write_unlock(&sco_sk_list.lock);
+	write_unlock_bh(&sco_sk_list.lock);
 
 done:
 	release_sock(sk);
@@ -897,7 +895,7 @@
 	struct sock *sk;
 	char *ptr = buf;
 
-	write_lock(&list->lock);
+	write_lock_bh(&list->lock);
 
 	for (sk = list->head; sk; sk = sk->next) {
 		pi = sco_pi(sk);
@@ -906,7 +904,7 @@
 				sk->state); 
 	}
 
-	write_unlock(&list->lock);
+	write_unlock_bh(&list->lock);
 
 	ptr += sprintf(ptr, "\n");
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-04 22:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-04 10:57 [PATCH] 2.4.19 Bluetooth [3/5] SCO fixes Maksim (Max)  Krasnyanskiy

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