From: Marcel Holtmann <marcel@holtmann.org>
To: Dave Young <hidave.darkstar@gmail.com>
Cc: linux-kernel@vger.kernel.org, bluez-devel@lists.sf.net
Subject: Re: [Bluez-devel] [PATCH]bluetooth rfcomm_dev refcount bug fix
Date: Mon, 05 Nov 2007 16:01:10 +0100 [thread overview]
Message-ID: <1194274870.4437.8.camel@aeonflux> (raw)
In-Reply-To: <20071105045921.GA3556@darkstar.te-china.tietoenator.com>
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
Hi Dave,
> In the rfcomm_tty_hangup the rfcomm_dev refcnt should be dropped later.
>
> If rfcomm_dev is destructed in tty_hangup function, then the later tty_close function will oops.
your patch removes the complete release on hangup logic. That can't be
right. I think the problem is with calling tty_vhangup() and then
decrementing the reference count. In case we call tty_vhangup and we
have release on hangup we should not delete the device here. What about
the attached patch? Does it solve it?
What are the steps to reproduce this?
Regards
Marcel
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 449 bytes --]
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index e447651..b405b9a 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -425,8 +425,11 @@ static int rfcomm_release_dev(void __user *arg)
if (dev->tty)
tty_vhangup(dev->tty);
- rfcomm_dev_del(dev);
- rfcomm_dev_put(dev);
+ if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) {
+ rfcomm_dev_del(dev);
+ rfcomm_dev_put(dev);
+ }
+
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 314 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- 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
next parent reply other threads:[~2007-11-05 15:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071105045921.GA3556@darkstar.te-china.tietoenator.com>
2007-11-05 15:01 ` Marcel Holtmann [this message]
[not found] <20071106060028.GA3176@darkstar.te-china.tietoenator.com>
2007-11-06 13:33 ` [Bluez-devel] [PATCH]bluetooth rfcomm_dev refcount bug fix Marcel Holtmann
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=1194274870.4437.8.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=bluez-devel@lists.sf.net \
--cc=bluez-devel@lists.sourceforge.net \
--cc=hidave.darkstar@gmail.com \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).