public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Maksim (Max) " Krasnyanskiy <maxk@qualcomm.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org, bluez-devel@usw-pr-web.sourceforge.net
Subject: [PATCH] 2.4.19 Bluetooth [3/5] SCO fixes
Date: 04 Aug 2002 03:57:18 -0700	[thread overview]
Message-ID: <1028458635.1003.42.camel@champ.qualcomm.com> (raw)

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


                 reply	other threads:[~2002-08-04 22:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1028458635.1003.42.camel@champ.qualcomm.com \
    --to=maxk@qualcomm.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bluez-devel@usw-pr-web.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox