All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Rfcomm kernel crashes (2.6.18.2)
Date: Mon, 20 Nov 2006 09:28:07 +0100	[thread overview]
Message-ID: <1164011287.28397.9.camel@localhost> (raw)
In-Reply-To: <c303508f0611181827s178b8776g57d3dbec37264691@mail.gmail.com>

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

Hi Axel,

> I have the following problem with Bluez/RFcomm:
> - I use a shell script that calls 'rfcomm listen rfcomm0 3' repeatedly
> to wait for a client to connect.
> - Everything works fine, except that every once in a while
> (unfortunately pretty often, like twice a day), the linux kernel
> crashes with the following message in syslog: 

so you have something to reproduce this. That is good. Please try out
the attached patch and report back if it fixes this for you.

Regards

Marcel


[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 1403 bytes --]

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index b8e3a5f..46c03f8 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -915,12 +915,14 @@ static void rfcomm_tty_unthrottle(struct
 static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty)
 {
 	struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
-	struct rfcomm_dlc *dlc = dev->dlc;
 
 	BT_DBG("tty %p dev %p", tty, dev);
 
-	if (!skb_queue_empty(&dlc->tx_queue))
-		return dlc->mtu;
+	if (!dev || !dev->dlc)
+		return 0;
+
+	if (!skb_queue_empty(&dev->dlc->tx_queue))
+		return dev->dlc->mtu;
 
 	return 0;
 }
@@ -928,11 +930,12 @@ static int rfcomm_tty_chars_in_buffer(st
 static void rfcomm_tty_flush_buffer(struct tty_struct *tty)
 {
 	struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
-	if (!dev)
-		return;
 
 	BT_DBG("tty %p dev %p", tty, dev);
 
+	if (!dev || !dev->dlc)
+		return;
+
 	skb_queue_purge(&dev->dlc->tx_queue);
 
 	if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup)
@@ -952,11 +955,12 @@ static void rfcomm_tty_wait_until_sent(s
 static void rfcomm_tty_hangup(struct tty_struct *tty)
 {
 	struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
-	if (!dev)
-		return;
 
 	BT_DBG("tty %p dev %p", tty, dev);
 
+	if (!dev)
+		return;
+
 	rfcomm_tty_flush_buffer(tty);
 
 	if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))

[-- Attachment #3: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2006-11-20  8:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-19  2:27 [Bluez-devel] Rfcomm kernel crashes (2.6.18.2) Axel Ruder
2006-11-20  8:28 ` Marcel Holtmann [this message]
2006-11-20  9:26   ` Stefan Seyfried
2006-11-20  9:35     ` Marcel Holtmann
2006-11-20 10:25       ` Stefan Seyfried
  -- strict thread matches above, loose matches on Subject: below --
2006-11-24  4:09 Axel Ruder
2006-11-28  2:06 Axel Ruder
2006-11-28  4:18 ` Marcel Holtmann
2006-11-28  4:21   ` Marcel Holtmann
2006-12-04 23:19     ` Axel Ruder

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=1164011287.28397.9.camel@localhost \
    --to=marcel@holtmann.org \
    --cc=bluez-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.