提交 c7e0c141 编写于 作者: M Marcel Holtmann 提交者: Johan Hedberg

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: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 68d96dcf
...@@ -539,7 +539,7 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file, ...@@ -539,7 +539,7 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file,
return -EUNATCH; return -EUNATCH;
case HCIUARTGETDEVICE: case HCIUARTGETDEVICE:
if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) if (test_bit(HCI_UART_REGISTERED, &hu->flags))
return hu->hdev->id; return hu->hdev->id;
return -EUNATCH; return -EUNATCH;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册