* [PATCH] Bluetooth: Fix HCIUARTGETDEVICE ioctl when UART is not registered
@ 2014-07-12 15:00 Marcel Holtmann
2014-07-12 15:38 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2014-07-12 15:00 UTC (permalink / raw)
To: linux-bluetooth
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>
---
drivers/bluetooth/hci_ldisc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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,
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;
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: Fix HCIUARTGETDEVICE ioctl when UART is not registered
2014-07-12 15:00 [PATCH] Bluetooth: Fix HCIUARTGETDEVICE ioctl when UART is not registered Marcel Holtmann
@ 2014-07-12 15:38 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2014-07-12 15:38 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth
Hi Marcel,
On Sat, Jul 12, 2014, Marcel Holtmann wrote:
> 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>
> ---
> drivers/bluetooth/hci_ldisc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to bluetooth-next. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-12 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-12 15:00 [PATCH] Bluetooth: Fix HCIUARTGETDEVICE ioctl when UART is not registered Marcel Holtmann
2014-07-12 15:38 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox