aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-07-12 11:00:29 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2014-07-12 11:37:34 -0400
commitc7e0c14115db67063a5f68fd9d4a12a54e649dc7 (patch)
tree66bf2358a905bb0846fbabc79efb02860d81f8c0 /drivers/bluetooth
parent68d96dcfc6c09b565d57897c127b61afbab74c6f (diff)
Bluetooth: Fix HCIUARTGETDEVICE ioctl when UART is not registered
The protocol for the UART might be configured, but that does not mean the HCI device is registered. Return an error in that case and only return the index number when HCI_UART_REGISTERED is set. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_ldisc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 401a3be57cda..dc487b5d1156 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -539,7 +539,7 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file,
539 return -EUNATCH; 539 return -EUNATCH;
540 540
541 case HCIUARTGETDEVICE: 541 case HCIUARTGETDEVICE:
542 if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) 542 if (test_bit(HCI_UART_REGISTERED, &hu->flags))
543 return hu->hdev->id; 543 return hu->hdev->id;
544 return -EUNATCH; 544 return -EUNATCH;
545 545