mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Young <hidave.darkstar@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-kernel@vger.kernel.org, bluez-devel@lists.sourceforge.net
Subject: Re: [PATCH][another try]bluetooth rfcomm tty_close before destruct
Date: Mon, 19 Nov 2007 12:57:33 +0800	[thread overview]
Message-ID: <20071119045733.GA3829@darkstar.te-china.tietoenator.com> (raw)
In-Reply-To: <20071119030005.GA3420@darkstar.te-china.tietoenator.com>

Hi,
This is the right patch which will not touch original tty logic. Please ignore last one submited by me.

Regards
dave

Subject:
rfcomm_dev_del could be called twice time in release function.
one by rfcomm_tty_hangup, another by rfcomm_release_dev, this will cause the device being destructed before rfcomm_tty_close.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com> 

---
tty.c |    4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff -upr linux/net/bluetooth/rfcomm/tty.c linux.new/net/bluetooth/rfcomm/tty.c
--- linux/net/bluetooth/rfcomm/tty.c	2007-11-19 10:48:32.000000000 +0800
+++ linux.new/net/bluetooth/rfcomm/tty.c	2007-11-19 12:48:10.000000000 +0800
@@ -424,8 +424,8 @@ static int rfcomm_release_dev(void __use
 	/* Shut down TTY synchronously before freeing rfcomm_dev */
 	if (dev->tty)
 		tty_vhangup(dev->tty);
-
-	rfcomm_dev_del(dev);
+	else if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
+		rfcomm_dev_del(dev);
 	rfcomm_dev_put(dev);
 	return 0;
 }

      reply	other threads:[~2007-11-19  4:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-05  4:59 [PATCH]bluetooth rfcomm_dev refcount bug fix Dave Young
2007-11-05 15:01 ` Marcel Holtmann
2007-11-06  1:23   ` Dave Young
2007-11-06  3:12   ` Dave Young
2007-11-19  3:00 ` [PATCH][another try]bluetooth rfcomm tty_close before destruct Dave Young
2007-11-19  4:57   ` Dave Young [this message]

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=20071119045733.GA3829@darkstar.te-china.tietoenator.com \
    --to=hidave.darkstar@gmail.com \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /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

all inboxes | Powered by JetHome®