Re: [PATCH] bluetooth : move children of connection device to NULL before connection down

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Marcel Holtmann <marcel@...>, <davem@...>, <netdev@...>, <linux-kernel@...>, <bluez-devel@...>, <cornelia.huck@...>, <gombasg@...>, <htejun@...>, <viro@...>, <kay.sievers@...>, <greg@...>
Date: Wednesday, January 23, 2008 - 9:26 pm

On Thu, Jan 24, 2008 at 09:19:26AM +0800, Dave Young wrote:
	~~~~~~~~~~~~~~~~~

Please ignore the previous silly one, now resubmit :
----------

rfcomm dev could be deleted in tty_hangup, so we must not call rfcomm_dev_del again to prevent from destroying rfcomm dev before tty close.

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

---
 net/bluetooth/rfcomm/tty.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -upr a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
--- a/net/bluetooth/rfcomm/tty.c	2008-01-24 09:21:56.000000000 +0800
+++ b/net/bluetooth/rfcomm/tty.c	2008-01-24 09:21:56.000000000 +0800
@@ -429,7 +429,8 @@ static int rfcomm_release_dev(void __use
 	if (dev->tty)
 		tty_vhangup(dev->tty);
 
-	rfcomm_dev_del(dev);
+	if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
+		rfcomm_dev_del(dev);
 	rfcomm_dev_put(dev);
 	return 0;
 }
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] bluetooth : move children of connection device t..., Dave Young, (Wed Jan 23, 9:26 pm)