Bluetooth: Fix HCIUARTGETDEVICE ioctl when UART is not registered
Marcel Holtmann
maintainerPATCH 1/1 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 <[email protected]>
--- drivers/bluetooth/hci_ldisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bluetooth/hci_ldisc.c +1 -1
@@ -539,7 +539,7 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file,return -EUNATCH ;case HCIUARTGETDEVICE : -if (test_bit (HCI_UART_PROTO_SET , &hu->flags)) +if (test_bit (HCI_UART_REGISTERED , &hu->flags))return hu->hdev->id;return -EUNATCH ;
Signature · 1 line
1.9.3
Johan Hedberg
AppliedHi Marcel,
Quoted 8 lines · Marcel Holtmann
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_REGISTEREDis set.Signed-off-by Marcel Holtmann <[email protected]>--- drivers/bluetooth/hci_ldisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to bluetooth-next. Thanks.
Johan