summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/rfcomm
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-02-10 02:59:16 +0100
committerMarcel Holtmann <marcel@holtmann.org>2014-02-14 22:39:31 +0100
commitb4d21f193985218c6c75969376249f69e49eb6ee (patch)
treed415f2724ad0624f1510505a0b6e174af5d52e04 /net/bluetooth/rfcomm
parentBluetooth: Fix unsafe RFCOMM device parenting (diff)
downloadlinux-b4d21f193985218c6c75969376249f69e49eb6ee.tar.xz
linux-b4d21f193985218c6c75969376249f69e49eb6ee.zip
Bluetooth: Fix RFCOMM parent device for reused dlc
The RFCOMM tty device is parented to the acl link device when the dlc state_change(BT_CONNECTED) notification is received. However, if the dlc from the RFCOMM socket is being reused (RFCOMM_REUSE_DLC is set), then the dlc may already be connected, and no notification will occur. Instead, always parent the RFCOMM tty device to the acl link device at registration time. If the acl link device is not available (eg, because the dlc is not connected) then the tty will remain unparented until the BT_CONNECTED notification is received. Fixes regression with ModemManager when the rfcomm device is created with the flag RFCOMM_REUSE_DLC. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Tested-By: Alexander Holler <holler@ahsoftware.de> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/rfcomm')
-rw-r--r--net/bluetooth/rfcomm/tty.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 2975bc4b9188..fa1226f17e86 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -316,6 +316,7 @@ out:
goto free;
}
+ rfcomm_reparent_device(dev);
dev_set_drvdata(dev->tty_dev, dev);
if (device_create_file(dev->tty_dev, &dev_attr_address) < 0)