[PATCH] 2.4.19 Bluetooth [3/5] SCO fixes

Maksim (maxk@qualcomm.com)
04 Aug 2002 03:57:18 -0700


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");

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/